koa-embed

1.0.0 • Public • Published

koa-embed

fast web service with koa buildin

example

const koaEmbed = require('koa-embed');

koaEmbed.start({
    port: 3000,
    app_route: './routes' // auto load all route files
});

koaEmbed.once('onListening', (port, host) => {
    console.log('onListening, onListening', port, host);
});

koaEmbed.on('onError', (err) => {
    console.log('test_server', err);
});

route file example

const koaEmbed = require('koaEmbed');
let router = koaEmbed.router();

router.get('/hello', async function (ctx, next) {
    ctx.json({hello: 'x'});
});

module.exports = router;

Dependencies (6)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i koa-embed

    Weekly Downloads

    3

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    15.9 kB

    Total Files

    16

    Last publish

    Collaborators

    • pisceanfoot