Package Exports
- koapi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (koapi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Koapi
RESTful API framework based on koa and bookshelf
Build a RESTful API with Koa will be dead simple
1. server.js
import Koapi, {Router, Model} from './src/koapi';
const app = new Koapi();
// Router
const posts = new Router();
posts.get('/', function*(){
this.body = 'Hello World';
});
app.run({
port: 4000,
debug: true,
cors: true,
serve: {
root: __dirname + '/public', // serve static file in ./public
},
routers: [ posts ], // Routers
});2. run server.js
babel-node server.js