api.js 822 B

1234567891011121314151617
  1. const config = require('../config.js')
  2. const routes = require('express').Router()
  3. const uploadController = require('../controllers/uploadController')
  4. const albumsController = require('../controllers/albumsController')
  5. const tokenController = require('../controllers/tokenController')
  6. routes.get ('/check', (req, res, next) => {
  7. return res.json({ private: config.private })
  8. })
  9. routes.get ('/uploads', (req, res, next) => uploadController.list(req, res))
  10. routes.post ('/upload', (req, res, next) => uploadController.upload(req, res, next))
  11. routes.get ('/albums', (req, res, next) => albumsController.list(req, res, next))
  12. routes.get ('/albums/test', (req, res, next) => albumsController.test(req, res, next))
  13. routes.get ('/token/verify', (req, res, next) => tokenController.verify(req, res))
  14. module.exports = routes