From 4975f7e191107c3faec80a3cbeccb565f9d57761 Mon Sep 17 00:00:00 2001 From: azures04 Date: Mon, 19 Jan 2026 02:47:55 +0100 Subject: [PATCH] Add static registration page and static file serving Added a new registration HTML page under data/static/register.html and introduced a static file serving route in routes/static.js. Minor adjustments were made to authRepository.js and userRepository.js to update module imports. This enables serving static assets and provides a registration UI. --- data/static/register.html | 60 ++++++++++++++++++++++++++++++++++ repositories/authRepository.js | 1 + repositories/userRepository.js | 1 - routes/static.js | 7 ++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 data/static/register.html create mode 100644 routes/static.js diff --git a/data/static/register.html b/data/static/register.html new file mode 100644 index 0000000..a270cbc --- /dev/null +++ b/data/static/register.html @@ -0,0 +1,60 @@ + + + + + + + + + Registration + + + +

+ + Lentia – Yggdrasil +

+

Page d'inscription

+
+
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/repositories/authRepository.js b/repositories/authRepository.js index 49b1687..b276d7f 100644 --- a/repositories/authRepository.js +++ b/repositories/authRepository.js @@ -1,5 +1,6 @@ const bcrypt = require("bcryptjs") const database = require("../modules/database") +const utils = require("../modules/utils") const { DefaultError } = require("../errors/errors") async function getUser(identifier, requirePassword = false) { diff --git a/repositories/userRepository.js b/repositories/userRepository.js index 3eb4b59..43378af 100644 --- a/repositories/userRepository.js +++ b/repositories/userRepository.js @@ -1,6 +1,5 @@ const utils = require("../modules/utils") const crypto = require("node:crypto") -const logger = require("../modules/logger") const database = require("../modules/database") const { DefaultError } = require("../errors/errors") diff --git a/routes/static.js b/routes/static.js new file mode 100644 index 0000000..5677354 --- /dev/null +++ b/routes/static.js @@ -0,0 +1,7 @@ +const path = require("node:path") +const expres = require("express") +const router = expres.Router() + +router.use(expres.static(path.join(process.cwd(), "data", "static"))) + +module.exports = router \ No newline at end of file