const router = require('express').Router() import intro from '../intro' router.use('/v1/blocks', require('./blocks')) router.use('/v1/events', require('./events')) router.use('/v1/eras', require('./eras')) router.use('/v1/accounts', require('./accounts')) router.use('/v1/councils', require('./councils')) router.use('/v1/members', require('./members')) router.use('/v1/proposals', require('./proposals')) router.use('/v1/channels', require('./channels')) router.use('/v1/categories', require('./categories')) router.use('/v1/threads', require('./threads')) router.use('/v1/posts', require('./posts')) router.get('/v1', (req: any, res: any, next: any) => { try { res.send(`
${intro}
`) } catch (err) { console.log(err) next() } }) router.get('/', (req: any, res: any, next: any) => { try { const versions = ['v1'] res.send(`Available versions: `) } catch (err) { console.log(err) next() } }) router.use((req: any, res: any, next: any) => { const error = new Error(`Not Found: /api${req.url}`) //console.log(req) //error.status = 404 next(error) }) module.exports = router