aboutsummaryrefslogtreecommitdiff
path: root/routes/web.js
blob: 8960bb363c47d23b8be69723ffe14d309c4fbb65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const express = require('express');
const router = express.Router();
const postController = require('../controllers/post');
const userController = require('../controllers/user');

router.get('/', postController.index);
router.get('/new-post', postController.create);
router.post('/new-post', postController.store);
router.get('/remove-post/:id', postController.destroy);

router.get('/register', userController.registerView);
router.get('/login', userController.loginView);

router.post('/register', userController.register);
router.post('/login', userController.login);

router.get('/logout', userController.logout);

module.exports = router;