Site.prototype.serve_jst = async function(env, pathname) {
let jst
try {
- jst = await js_template(this.root, this.root, this.root + pathname)
+ jst = await js_template(this.root, this.root, pathname)
}
catch (err) {
if (err.code !== 'ENOENT')
if (err.code !== 'ENOENT')
throw err
console.log(
- `${env.parsed_url.host} directory not found: ${pathname}`
+ `${env.parsed_url.host} directory not found ${pathname}`
)
this.server.die(env.response)
return
}
if (!stats.isDirectory()) {
console.log(
- `${env.parsed_url.host} not directory: ${pathname}`
+ j < env.pathname.length ?
+ `${env.parsed_url.host} not directory ${pathname}` :
+ `${env.parsed_url.host} unknown filetype "${filetype}" in ${pathname}`
)
this.server.die(env.response)
return
".js": "application/javascript; charset=utf-8",
".json": "application/json; charset=utf-8",
".png": "image/png",
+ ".svg": "image/svg+xml",
".xml": "text/xml; charset=utf-8"
}