diff --git a/server/index.ts b/server/index.ts index 977bfcf..e54d521 100644 --- a/server/index.ts +++ b/server/index.ts @@ -16,6 +16,8 @@ const users = new FunkyArray(); new Database(Config.database.address, Config.database.port, Config.database.username, Config.database.password, Config.database.name); +// Web stuff + const fastify = Fastify({ logger: false }); @@ -30,6 +32,24 @@ fastify.get("/", async (req, res) => { return res.view("templates/index.ejs", { }); }); +fastify.get("/account", async (req, res) => { + return "TODO"; +}); + +fastify.get("/account/login", async (req, res) => { + return res.view("templates/account/login.ejs", { }); +}); + +fastify.get("/account/register", async (req, res) => { + return res.view("templates/account/register.ejs", { }); +}); + +fastify.setNotFoundHandler(async (req, res) => { + return res.view("templates/404.ejs", { }); +}); + +// Websocket stuff + const websocketServer = new WebSocketServer({ port: Config.ports.ws }, () => { diff --git a/server/templates/404.ejs b/server/templates/404.ejs new file mode 100644 index 0000000..71c5ac2 --- /dev/null +++ b/server/templates/404.ejs @@ -0,0 +1,3 @@ +<%- include("base/header") -%> +

404!

+<%- include("base/footer") -%> \ No newline at end of file diff --git a/server/templates/account/login.ejs b/server/templates/account/login.ejs new file mode 100644 index 0000000..c0daa8e --- /dev/null +++ b/server/templates/account/login.ejs @@ -0,0 +1,22 @@ +<%- include("../base/header") -%> +

Login

+
+
+
+
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+<%- include("../base/footer") -%> \ No newline at end of file diff --git a/server/templates/base/header.ejs b/server/templates/base/header.ejs index 3bf676f..25b1afe 100644 --- a/server/templates/base/header.ejs +++ b/server/templates/base/header.ejs @@ -1,5 +1,5 @@ - + @@ -20,7 +20,8 @@ + Login -
\ No newline at end of file +
\ No newline at end of file diff --git a/server/templates/home.ejs b/server/templates/home.ejs new file mode 100644 index 0000000..be3e626 --- /dev/null +++ b/server/templates/home.ejs @@ -0,0 +1,3 @@ +<%- include("base/header") -%> +

Welcome back USER!

+<%- include("base/footer") -%> \ No newline at end of file