remove file:// on view engine template render

master
Garrett Mills 4 years ago
parent 0c4b8c11d7
commit c482216565
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -1,6 +1,6 @@
TLS support
internationalization
uploads & universal path
uploads & universal path!!
CLI - view routes, template generation, start server, directives, output, args
nicer error and home pages
favicon

@ -72,7 +72,10 @@ console.log('view engine template dir', { base_dir, template_dir: this.template_
* @return Promise<string>
*/
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}`)

Loading…
Cancel
Save