typescript(translucid): fixed forbbiden sendFile
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
76430ff691
commit
2f229fb449
2 changed files with 7 additions and 2 deletions
typescript/translucid
|
@ -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}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue