-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
28 lines (21 loc) · 932 Bytes
/
routes.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
25
26
27
28
const express = require('express');
// Importando controllers
const UserController = require('./controllers/UserController');
const Addresses = require('./controllers/AddressController');
const TechController = require('./controllers/TechController');
const ReportController = require('./controllers/ReportController')
const routes = express.Router();
// Users routers
routes.get('/users', UserController.index);
routes.post('/users', UserController.store);
// Addresses routes
routes.get('/users/:user_id/addresses', Addresses.index);
routes.get('/addresses', Addresses.indexAll);
routes.post('/users/:user_id/addresses', Addresses.store);
// Techs routes
routes.get('/users/:user_id/techs', TechController.index);
routes.post('/users/:user_id/techs', TechController.store);
routes.delete('/users/:user_id/techs', TechController.delete);
// Report route
routes.get('/report/', ReportController.show)
module.exports = routes;