-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
37 lines (29 loc) · 1.35 KB
/
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
29
30
31
32
33
34
35
36
37
const express = require('express');
const multer = require('multer');
const uploadConfig = require('./config/upload');
const UserController = require('./controllers/UserController');
const AulaController = require('./controllers/AulaController');
const LoginController = require('./controllers/LoginController');
const AlunoController = require('./controllers/AlunoController');
const ProfessorController = require('./controllers/ProfessorController');
const ListaController = require('./controllers/ListaController');
const routes = express.Router();
const upload = multer(uploadConfig);
{/* Rotas para User */ }
routes.get('/user',UserController.index);
routes.post('/user',upload.single('userImagem'), UserController.store);
routes.delete('/user/:id',UserController.delete)
routes.patch('/user/:id',UserController.update)
{/* Rotas de Login */}
routes.post('/login',LoginController.store);
routes.get('/login',LoginController.index);//Rota pra DEV
{/* Rotas para Aula */}
routes.post('/aula',upload.single('aulaImagem'), AulaController.store);
routes.get('/aula', AulaController.index);
routes.patch('/aula', AulaController.update);
routes.delete('/aula/:id',AulaController.delete);
{/* Rotas para Aluno */}
routes.get('/aluno', AlunoController.index);
routes.get('/professor',ProfessorController.index);
routes.get('/lista',ListaController.index);
module.exports = routes;