1
0
mwe-comments/server/api/index.js
2019-07-13 07:56:06 -04:00

21 lines
401 B
JavaScript
Executable File

const router = require('express').Router()
module.exports = router
const ascii = require('../ascii')
router.use('/comments', require('./comments'))
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)
})