-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.js
31 lines (24 loc) · 1.26 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
const express = require('express')
const routes = express.Router()
var homeController = require('./controllers/homeController')
var userController = require('./controllers/userController')
var noticeController = require('./controllers/noticeController')
var categoryController = require('./controllers/categoryController')
routes.get('/', homeController.getHome)
routes.post('/login', userController.login)
routes.post('/signup', userController.signup)
routes.get('/users', userController.getUsers)
routes.get('/users/:id', userController.getUser)
routes.put('/users/:id', userController.updateUser)
routes.delete('/users/:id', userController.removeUser)
routes.get('/users/:id/notices', noticeController.getNoticesUser)
routes.get('/notices', noticeController.getNotices)
routes.post('/notices', noticeController.createNotice)
routes.post('/notices/:id/comment', noticeController.postComment)
routes.get('/notices/:id', noticeController.getNotice)
routes.put('/notices/:id', noticeController.updateNotice)
routes.delete('/notices/:id', noticeController.removeNotice)
routes.get('/categories', categoryController.getCategories)
routes.post('/categories', categoryController.createCategory)
routes.delete('/categories/:id', categoryController.removeCategory)
module.exports = routes;