import * as errorHandler from './error_handler';
import * as machine from './machine';

var router = require('koa-trie-router');
var bodyParser = require('koa-bodyparser');
var koa = require('koa');
var app = koa();

app.use(errorHandler.handle);
app.use(bodyParser());
app.use(router(app));

app.route('/machines')
  .get(machine.list)
  .post(machine.create);

app.route('/machines/:name')
  .get(machine.inspect)
  .post(machine.create)
  .delete(machine.remove);

app.listen(3000);

import * as errorHandler from './error_handler';
import * as machine from './machine';

var r = require('koa-route');
var bodyParser = require('koa-bodyparser');
var koa = require('koa');
var app = koa();

app.use(errorHandler.handle);
app.use(bodyParser());
app.use(require('koa-trie-router')(app));

app.route('/machines')
  .get(machine.list)
  .post(machine.create);

app.route('/machines/:name')
  .get(machine.inspect)
  .post(machine.create)
  .delete(machine.remove);

app.listen(3000);

--- 
+++ 
@@ -1,14 +1,14 @@
 import * as errorHandler from './error_handler';
 import * as machine from './machine';
 
-var r = require('koa-route');
+var router = require('koa-trie-router');
 var bodyParser = require('koa-bodyparser');
 var koa = require('koa');
 var app = koa();
 
 app.use(errorHandler.handle);
 app.use(bodyParser());
-app.use(require('koa-trie-router')(app));
+app.use(router(app));
 
 app.route('/machines')
   .get(machine.list)
Fix koa-router not found bug
