Conversation
…into checkin-endpoints
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hack4impact/closegap/701ab026u |
yousefa00
left a comment
There was a problem hiding this comment.
Amazing, left some small comments 🚀
api/src/routes/index.js
Outdated
| const express = require("express"); | ||
| const { StatusCodes } = require("http-status-codes"); | ||
|
|
||
| const { getStudentById } = require("../services/student.js"); | ||
|
|
||
| const router = express.Router(); |
There was a problem hiding this comment.
Very nitpicky, but do you think we should reorder these imports, moving router under express and the two others immediately below and without a new line between them?
There was a problem hiding this comment.
Fixed! In general, I think it's still a good idea to separate third-party requires and internal requires with a blank line, though. So we can differentiate them at a glance. I pushed a new commit as an example.
There was a problem hiding this comment.
const express = require("express");
const router = express.Router();
const statusCodes = require("http-status-codes");
const { getStudentById } = require("../services/student.js");There was a problem hiding this comment.
Yep we should do this instead, thanks for pointing that out :)
Also this is a phenomenal description, definitely setting a great precedent, we all have to step up the game now lol |
Status:
🚀 Ready
Description
Setup backend DB and add example service.
Example route
/students/{id}works for testing DB.Why a service layer
Workflow for service layer
../services/MODULE.js../routes/MODULE.js../services/MODULE.js