-
Notifications
You must be signed in to change notification settings - Fork 2
Setup backend DB and add example service #8
base: master
Are you sure you want to change the base?
Conversation
…into checkin-endpoints
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hack4impact/closegap/701ab026u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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