From 5ab3cbaa54642ada07085d1e0aa2e984dec1849a Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 29 May 2025 06:17:12 +0200 Subject: Allow unfree in nix flake, add mongodb-compass to devShell closure, basic mongo attempt, add test register route --- src/api/routes/auth/index.js | 1 + src/api/routes/auth/registerRoute.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/api/routes/auth/index.js create mode 100644 src/api/routes/auth/registerRoute.js (limited to 'src/api/routes/auth') diff --git a/src/api/routes/auth/index.js b/src/api/routes/auth/index.js new file mode 100644 index 0000000..8306697 --- /dev/null +++ b/src/api/routes/auth/index.js @@ -0,0 +1 @@ +export * from "./registerRoute.js"; diff --git a/src/api/routes/auth/registerRoute.js b/src/api/routes/auth/registerRoute.js new file mode 100644 index 0000000..b71c466 --- /dev/null +++ b/src/api/routes/auth/registerRoute.js @@ -0,0 +1,14 @@ +import { User } from "#db/schemas/userSchema.js"; + +export const registerRoute = { + route: "/auth/register", + async onGet(req, res) { + const result = await User.create({ + username: req.query.username, + password: req.query.password, + email: req.query.email, + }); + + res.send(result); + }, +}; -- cgit 1.5.1