Add preferredd hostname env var

This commit is contained in:
root 2021-06-17 23:29:07 -05:00
parent b769a5d6b9
commit 8c64e88200
2 changed files with 3 additions and 2 deletions

@ -6,7 +6,8 @@ module.exports = {
"log_file": "qonq.log",
"env": {
"NODE_ENV": "production",
"ADDRESS": "127.0.0.1"
"ADDRESS": "127.0.0.1",
"PREFERRED_HOST": "owo69.me"
}
}
]

@ -37,7 +37,7 @@ app.post("/upload", (req, res, next) => {
} catch(e) {
return next(e);
}
res.send(`${req.protocol}://${filecode}.${req.headers.host}`);
res.send(`${req.protocol}://${filecode}.${process.env.PREFERRED_HOST||req.headers.host}`);
});
});