summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-13 06:17:14 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-13 06:17:14 +0900
commitc54ff5b2bced1dd3d15f98e4a8a40523a0fcea78 (patch)
tree06f8ed507ea1916850db155122805e3c43653443
parentwip (diff)
downloadsharkey-c54ff5b2bced1dd3d15f98e4a8a40523a0fcea78.tar.gz
sharkey-c54ff5b2bced1dd3d15f98e4a8a40523a0fcea78.tar.bz2
sharkey-c54ff5b2bced1dd3d15f98e4a8a40523a0fcea78.zip
wip
-rw-r--r--package.json1
-rw-r--r--src/server/index.ts9
2 files changed, 7 insertions, 3 deletions
diff --git a/package.json b/package.json
index 3e349203fc..b611f603c9 100644
--- a/package.json
+++ b/package.json
@@ -150,6 +150,7 @@
"js-yaml": "3.11.0",
"jsdom": "11.7.0",
"koa": "^2.5.0",
+ "koa-bodyparser": "^4.2.0",
"koa-favicon": "^2.0.1",
"koa-mount": "^3.0.0",
"koa-multer": "^1.0.2",
diff --git a/src/server/index.ts b/src/server/index.ts
index f0d60fa651..02362037ee 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -8,6 +8,7 @@ import * as https from 'https';
import * as Koa from 'koa';
import * as Router from 'koa-router';
import * as bodyParser from 'koa-bodyparser';
+import * as mount from 'koa-mount';
import activityPub from './activitypub';
import webFinger from './webfinger';
@@ -27,15 +28,17 @@ if (config.url.startsWith('https')) {
});
}
+app.use(mount('/api', require('./api')));
+app.use(mount('/files', require('./file')));
+
// Init router
const router = new Router();
// Routing
-router.use('/api', require('./api'));
-router.use('/files', require('./file'));
router.use(activityPub.routes());
router.use(webFinger.routes());
-router.use(require('./web'));
+
+app.use(mount(require('./web')));
// Register router
app.use(router.routes());