server/api/index.js
2019-03-06 18:46:28 -05:00

21 lines
395 B
JavaScript
Executable File

const router = require('express').Router()
module.exports = router
const ascii = require('../ascii')
router.use('/items', require('./items'))
router.get('/', async (req, res, next) => {
try {
res.json({ ascii })
} catch (err) {
console.log(err)
next()
}
})
router.use((req, res, next) => {
const error = new Error('Not Found!!!!!!!')
error.status = 404
next(error)
})