This file contains hidden or 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
import Datastore from "@seald-io/nedb"; | |
const dbfile = "collection.db" | |
const test = new Datastore({ filename: dbfile, autoload: true }); |
This file contains hidden or 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
var router = require('koa-router')({prefix: '/api'}); // << important | |
router.get('/something', function *(next ){ | |
this.body = yield getSomething() | |
}); | |
router.get('/somewhere', function *(next ){ | |
this.body = yield someWhere() | |
}); |