- Before you write the code itself following TDD practices.
- A model is the representation of a resource. For example, if we have a user resource, the user model could be as follows:
export interface User {
id: Number
username: String
firstName: String
lastName: String
email: String
password: String
phone: String
userStatus: Number
}
- Take the following URI:
http://localhost:3000/store/inventory?order-status=PLACED
You can get the query order-status as follows:
export let getInventory = (req: Request, res: Response, next: NextFunction) => {
const status = req.query.status
...
}
- You can pass unlimited query strings.
- It should only contain route information and point the methods to the controllers that will handle and process the operation, as follows:
import * as orderController from '../controllers/order'
export class OrderRoute {
public routes(app...