-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
24 lines (17 loc) · 898 Bytes
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const connection = require('./db')
const express = require('express')
const router = express.Router()
const CategoryController = require('./controllers/CategoryController')
const AuthorController = require('./controllers/AuthorController')
// const BookController = require('./controllers/BookController')
router.post('/categoria/nova',CategoryController.create)
router.get('/categorias/', CategoryController.index)
router.get('/categoria/:id', CategoryController.find)
router.put('/categoria/:id/atualizar',CategoryController.update)
router.delete('/categoria/:id/remover',CategoryController.delete)
router.post('/autor/novo',AuthorController.create)
router.get('/autores/', AuthorController.index)
router.get('/autor/:id', AuthorController.find)
router.put('/autor/:id/atualizar',AuthorController.update)
router.delete('/autor/:id/remover',AuthorController.delete)
module.exports = router