12 lines
318 B
TypeScript
12 lines
318 B
TypeScript
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)
|
|
}) |