summary refs log tree commit diff
path: root/src/api/routes
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-29 22:48:16 +0200
committerRory& <root@rory.gay>2025-05-29 22:48:48 +0200
commit9d33b2fe6b3fbea60d981d9f4ed24cf82b05a7af (patch)
treeee44d3b3df88febdce52efe436f4582820fb6471 /src/api/routes
parentGet database working (diff)
downloadnodejs-final-assignment-9d33b2fe6b3fbea60d981d9f4ed24cf82b05a7af.tar.xz
Prettier config
Diffstat (limited to 'src/api/routes')
-rw-r--r--src/api/routes/auth/index.js2
-rw-r--r--src/api/routes/auth/registerRoute.js20
-rw-r--r--src/api/routes/index.js6
-rw-r--r--src/api/routes/indexRoute.js8
-rw-r--r--src/api/routes/statusRoute.js20
5 files changed, 28 insertions, 28 deletions
diff --git a/src/api/routes/auth/index.js b/src/api/routes/auth/index.js

index 8306697..7113a17 100644 --- a/src/api/routes/auth/index.js +++ b/src/api/routes/auth/index.js
@@ -1 +1 @@ -export * from "./registerRoute.js"; +export * from './registerRoute.js'; diff --git a/src/api/routes/auth/registerRoute.js b/src/api/routes/auth/registerRoute.js
index 14188a4..725c7d8 100644 --- a/src/api/routes/auth/registerRoute.js +++ b/src/api/routes/auth/registerRoute.js
@@ -1,14 +1,14 @@ -import { User } from "#db/schemas/user.js"; +import { User } from '#db/schemas/user.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, - }); + 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); - }, + res.send(result); + } }; diff --git a/src/api/routes/index.js b/src/api/routes/index.js
index 147246e..745dd27 100644 --- a/src/api/routes/index.js +++ b/src/api/routes/index.js
@@ -1,4 +1,4 @@ -export * from "./statusRoute.js"; -export * from "./indexRoute.js"; +export * from './statusRoute.js'; +export * from './indexRoute.js'; -export * from "./auth/index.js"; +export * from './auth/index.js'; diff --git a/src/api/routes/indexRoute.js b/src/api/routes/indexRoute.js
index 3685893..3b9eaef 100644 --- a/src/api/routes/indexRoute.js +++ b/src/api/routes/indexRoute.js
@@ -1,6 +1,6 @@ export const indexRoute = { - route: "/", - onGet(req, res) { - res.send("What art thou doing here???"); - }, + route: '/', + onGet(req, res) { + res.send('What art thou doing here???'); + } }; diff --git a/src/api/routes/statusRoute.js b/src/api/routes/statusRoute.js
index b9974a5..41208a4 100644 --- a/src/api/routes/statusRoute.js +++ b/src/api/routes/statusRoute.js
@@ -1,14 +1,14 @@ -import { User } from "#db/schemas/user.js"; +import { User } from '#db/schemas/user.js'; export const statusRoute = { - route: "/status", - async onGet(req, res) { - const status = { - status: "ok", - timestamp: new Date().toISOString(), - users: await User.countDocuments(), - }; + route: '/status', + async onGet(req, res) { + const status = { + status: 'ok', + timestamp: new Date().toISOString(), + users: await User.countDocuments() + }; - res.status(200).json(status); - }, + res.status(200).json(status); + } };