-
-
Save amandeepmittal/a42da174f381bfa403c295bebf2dbc77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// books.js | |
const Router = require('koa-router'); | |
// Prefix all routes with: /books | |
const router = new Router({ | |
prefix: '/books' | |
}); | |
let books = [ | |
{ id: 101, name: 'Fight Club', author: 'Chuck Palahniuk' }, | |
{ id: 102, name: 'Sharp Objects', author: 'Gillian Flynn' }, | |
{ id: 103, name: 'Frankenstein', author: 'Mary Shelley' }, | |
{ id: 101, name: 'Into The Wild', author: 'John Krakauer' } | |
]; | |
// Routes will go here | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment