summary refs log tree commit diff
path: root/src/api/routes/auth
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/auth')
-rw-r--r--src/api/routes/auth/index.js1
-rw-r--r--src/api/routes/auth/registerRoute.js14
2 files changed, 15 insertions, 0 deletions
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); + }, +};