From 54e06aa44a3134dfc42db3e4b473abf5e181fc42 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 19 Nov 2022 18:41:35 +0100 Subject: cleaned up the distinction between routes and controllers --- controllers/root/root.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 controllers/root/root.js (limited to 'controllers/root/root.js') diff --git a/controllers/root/root.js b/controllers/root/root.js new file mode 100644 index 0000000..062edf4 --- /dev/null +++ b/controllers/root/root.js @@ -0,0 +1,6 @@ +export function root_get(req, res) { + if (req.session.user !== undefined) { + return res.redirect(302, "/games"); + } + return res.redirect(302, "/login"); +} -- cgit v1.2.3