Initial server setup
This commit is contained in:
parent
81c1ba4cf1
commit
d2707da076
2 changed files with 20 additions and 0 deletions
17
server/index.js
Normal file
17
server/index.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
const Koa = require('koa');
|
||||
const Router = require('koa-router');
|
||||
const Static = require('koa-static');
|
||||
const path = require('path');
|
||||
|
||||
const app = new Koa();
|
||||
const router = new Router();
|
||||
|
||||
app
|
||||
.use(router.routes())
|
||||
.use(router.allowedMethods())
|
||||
.use(Static(path.resolve(__dirname, '../dist'), {}));
|
||||
|
||||
module.exports = app;
|
||||
if (!module.parent) {
|
||||
app.listen(8080);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue