redirects: adds redirect for system page

This commit is contained in:
jimmylee 2020-08-18 23:15:14 -07:00
parent 63e8abaf89
commit d4f19b9abf
2 changed files with 7 additions and 3 deletions

View File

@ -10,6 +10,8 @@ const REJECT_LIST = [
"_next",
"next",
"webpack",
"system",
"experience",
"root",
"www",
"website",

View File

@ -47,6 +47,10 @@ app.prepare().then(async () => {
});
});
server.get("/system", async (req, res) => {
res.redirect("/_/system");
});
server.get("/:username", async (req, res) => {
// TODO(jim): Temporary workaround
if (!Validations.userRoute(req.params.username)) {
@ -122,9 +126,7 @@ app.prepare().then(async () => {
}
return app.render(req, res, "/_/slate", {
slate: JSON.parse(
JSON.stringify({ ...slate, ownername: req.params.username })
),
slate: JSON.parse(JSON.stringify({ ...slate, ownername: req.params.username })),
});
});