Fix db relations, add sample data, show categories in frontend menu
This commit is contained in:
12
software/backend/routes/product.routes.ts
Normal file
12
software/backend/routes/product.routes.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Router, Request, Response, NextFunction } from "express";
|
||||
import { Product } from "../models/product.model";
|
||||
|
||||
export const product = Router()
|
||||
|
||||
product.get("/", (req: Request, res: Response, next: NextFunction)=> {
|
||||
Product.findAll()
|
||||
.then(products => {
|
||||
res.json(products)
|
||||
})
|
||||
.catch(next)
|
||||
})
|
||||
Reference in New Issue
Block a user