Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = require('config');
- const port = process.env.PORT || config.get('port') || 80;
- const Koa = require('koa');
- const serve = require('koa-static');
- const http = require('http');
- const Api = require('@ennis/api');
- require('./apis');
- Api.prefix('/api0');
- const app = new Koa();
- app.use(Api.middleware());
- app.use(serve('../dist'));
- const server = http.createServer(app.callback())
- server.listen(port, () => {
- console.log('server listening on port '+port);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement