Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created October 4, 2018 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/a42da174f381bfa403c295bebf2dbc77 to your computer and use it in GitHub Desktop.
Save amandeepmittal/a42da174f381bfa403c295bebf2dbc77 to your computer and use it in GitHub Desktop.
// 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