1
Fork 0

typescript(translucid): fixed forbbiden sendFile

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-01-22 22:35:44 +02:00 committed by prescientmoon
parent 76430ff691
commit 2f229fb449
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
2 changed files with 7 additions and 2 deletions
typescript/translucid

View file

@ -1,6 +1,9 @@
const express = require('express');
const path = require('path');
import {read} from "./read";
const dir = path.dirname(require.main.filename);
interface Middleware{
name:string;
keys:Array<string>;
@ -61,7 +64,7 @@ class Translucid {
res.sendFile(prev);
});
decorated[0]((!sendFiles)?readResults:`${__dirname}/../../${filepath}`);
decorated[0]((!sendFiles)?readResults:`${dir}/${filepath}`);
});
}
}