2022-02-13 08:28:33 +00:00
|
|
|
const { Router } = require('express')
|
|
|
|
const controller = require('../controllers/minify')
|
|
|
|
const { auth } = require('../middlewares/auth')
|
2022-01-31 19:44:34 +00:00
|
|
|
|
2022-02-13 08:28:33 +00:00
|
|
|
const router = Router()
|
2022-01-31 19:44:34 +00:00
|
|
|
|
2022-02-13 08:28:33 +00:00
|
|
|
router.get('/all', controller.getAllData)
|
|
|
|
router.get('/id/:id', controller.findUrlById)
|
|
|
|
router.get('/alias/:alias', controller.getURLData)
|
2022-01-31 19:44:34 +00:00
|
|
|
|
2022-02-13 08:28:33 +00:00
|
|
|
router.post('/add', controller.addURL)
|
|
|
|
router.post('/add/custom', auth, controller.addURLAuthed)
|
2022-02-01 05:39:00 +00:00
|
|
|
|
2022-02-13 05:04:30 +00:00
|
|
|
router.patch('/edit/:id', auth, controller.updateUrlData)
|
2022-02-01 15:10:46 +00:00
|
|
|
|
2022-02-13 08:28:33 +00:00
|
|
|
router.delete('/delete/:id', auth, controller.deleteUrlData)
|
2022-02-01 19:15:36 +00:00
|
|
|
|
2022-02-28 18:42:57 +00:00
|
|
|
router.get('/:alias/views', controller.visitor)
|
|
|
|
|
2022-02-13 08:28:33 +00:00
|
|
|
module.exports = router
|