1
Fork 0

typescript(translucid): fixed express static file path without __dirname

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-01-20 13:09:45 +02:00 committed by prescientmoon
parent aea0646dc8
commit 96bc542e76
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -18,7 +18,7 @@ class Translucid {
this.midleware.push(obj);
}
public(path = "") {
this.app.use(`${__dirname}/../../${path}`, express.static(`${__dirname}/../../${path}`));
this.app.use(`/${path}`, express.static(`/${path}`));
}
bind(path = "/", filepath = "", classes = []) {
this.app.get(path, async (req, res) => {