mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-15 00:46:22 +00:00
22 lines
950 B
JavaScript
22 lines
950 B
JavaScript
const config = require('../config.js')
|
|
const routes = require('express').Router()
|
|
const uploadController = require('../controllers/uploadController')
|
|
const albumsController = require('../controllers/albumsController')
|
|
const tokenController = require('../controllers/tokenController')
|
|
|
|
routes.get ('/check', (req, res, next) => {
|
|
return res.json({
|
|
private: config.private,
|
|
maxFileSize: config.uploads.maxsize
|
|
})
|
|
})
|
|
|
|
routes.get ('/uploads', (req, res, next) => uploadController.list(req, res))
|
|
routes.post ('/upload', (req, res, next) => uploadController.upload(req, res, next))
|
|
routes.get ('/albums', (req, res, next) => albumsController.list(req, res, next))
|
|
routes.post ('/albums', (req, res, next) => albumsController.create(req, res, next))
|
|
routes.get ('/albums/test', (req, res, next) => albumsController.test(req, res, next))
|
|
routes.get ('/token/verify', (req, res, next) => tokenController.verify(req, res))
|
|
|
|
module.exports = routes
|