fix small issues

This commit is contained in:
wukko
2022-09-01 19:51:18 +06:00
parent e61122d5b0
commit f70128f4fc
11 changed files with 40 additions and 49 deletions

View File

@@ -96,10 +96,10 @@ if (fs.existsSync('./.env')) {
res.status(500).json({ 'status': 'error', 'text': 'something went wrong.' })
}
});
app.get("/api", async (req, res) => {
app.get("/api", (req, res) => {
res.redirect('/api/json')
});
app.get("/", async (req, res) => {
app.get("/", (req, res) => {
// redirect masochists to a page where they can install a proper browser
if (req.header("user-agent") && req.header("user-agent").includes("Trident")) {
if (internetExplorerRedirect.newNT.includes(req.header("user-agent").split('NT ')[1].split(';')[0])) {
@@ -118,10 +118,10 @@ if (fs.existsSync('./.env')) {
}))
}
});
app.get("/favicon.ico", async (req, res) => {
app.get("/favicon.ico", (req, res) => {
res.redirect('/icons/favicon.ico');
});
app.get("/*", async (req, res) => {
app.get("/*", (req, res) => {
res.redirect('/')
});
app.listen(process.env.port, () => {