remove file:// on view engine template render
This commit is contained in:
parent
0c4b8c11d7
commit
c482216565
2
TODO.txt
2
TODO.txt
@ -1,6 +1,6 @@
|
|||||||
TLS support
|
TLS support
|
||||||
internationalization
|
internationalization
|
||||||
uploads & universal path
|
uploads & universal path!!
|
||||||
CLI - view routes, template generation, start server, directives, output, args
|
CLI - view routes, template generation, start server, directives, output, args
|
||||||
nicer error and home pages
|
nicer error and home pages
|
||||||
favicon
|
favicon
|
||||||
|
@ -72,7 +72,10 @@ console.log('view engine template dir', { base_dir, template_dir: this.template_
|
|||||||
* @return Promise<string>
|
* @return Promise<string>
|
||||||
*/
|
*/
|
||||||
public async template(template_path: string, data: { [key: string]: any } = {}) {
|
public async template(template_path: string, data: { [key: string]: any } = {}) {
|
||||||
const file_path = `${this.template_path(template_path.replace(/:/g, '/'))}${this.get_file_extension()}`
|
let file_path = `${this.template_path(template_path.replace(/:/g, '/'))}${this.get_file_extension()}`
|
||||||
|
if ( file_path.startsWith('file://') ) {
|
||||||
|
file_path = file_path.slice(7)
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.debug(`Rendering template "${template_path}" from file: ${file_path}`)
|
this.logger.debug(`Rendering template "${template_path}" from file: ${file_path}`)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user