SHARE
TWEET

Untitled

a guest Oct 21st, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const config = require('config');
  2. const port = process.env.PORT || config.get('port') || 80;
  3. const Koa = require('koa');
  4. const serve = require('koa-static');
  5. const http = require('http');
  6. const Api = require('@ennis/api');
  7.  
  8. require('./apis');
  9. Api.prefix('/api0');
  10.  
  11. const app = new Koa();
  12.  
  13. app.use(Api.middleware());
  14.  
  15. app.use(serve('../dist'));
  16.  
  17. const server = http.createServer(app.callback())
  18. server.listen(port, () => {
  19.     console.log('server listening on port '+port);
  20. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top