mirror of
https://github.com/GithubOrgProjectPiza/server.git
synced 2026-09-06 15:46:02 +02:00
Add auth to the endpoints
_Well at least I think, idk if it works, please help me, aaaaaahhh_
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import express from "express";
|
||||
import { getPizzas, addPizza, deletePizza, getPizza, updatePizza } from "../controller/pizzas.controller";
|
||||
import { requireAuthentication } from "../middleware/auth.middle";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", getPizzas);
|
||||
router.get("/:id", getPizza);
|
||||
router.post("/", addPizza);
|
||||
router.put("/:id", updatePizza);
|
||||
router.delete("/:id", deletePizza);
|
||||
router.post("/", requireAuthentication, addPizza);
|
||||
router.put("/:id", requireAuthentication, updatePizza);
|
||||
router.delete("/:id", requireAuthentication, deletePizza);
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user