-
-
Save amandeepmittal/afbbdbed1015f1649ecd74c4dcae2c71 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
// app.js | |
const Koa = require('koa'); | |
const koaBody = require('koa-body'); | |
const app = new Koa(); | |
// Set up body parsing middleware | |
app.use(koaBody()); | |
// Require the Router we defined in books.js | |
let books = require('./books.js'); | |
// Use the Router on the sub route /books | |
app.use(books.routes()); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment