From d68cc702a5e217574776351e560b3d1cd97a6a23 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 29 Mar 2018 20:50:45 +0900 Subject: [PATCH] oops --- src/{client/docs/server.ts => server/web/docs.ts} | 6 ++++-- src/server/web/index.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) rename src/{client/docs/server.ts => server/web/docs.ts} (59%) diff --git a/src/client/docs/server.ts b/src/server/web/docs.ts similarity index 59% rename from src/client/docs/server.ts rename to src/server/web/docs.ts index b2e50457e5..e332d4fab5 100644 --- a/src/client/docs/server.ts +++ b/src/server/web/docs.ts @@ -4,18 +4,20 @@ import * as express from 'express'; +const docs = `${__dirname}/../../client/docs/`; + /** * Init app */ const app = express(); app.disable('x-powered-by'); -app.use('/assets', express.static(`${__dirname}/assets`)); +app.use('/assets', express.static(`${docs}/assets`)); /** * Routing */ app.get(/^\/([a-z_\-\/]+?)$/, (req, res) => - res.sendFile(`${__dirname}/${req.params[0]}.html`)); + res.sendFile(`${docs}/${req.params[0]}.html`)); module.exports = app; diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 2fc8f1b8ab..445f03de1f 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -17,7 +17,7 @@ const client = `${__dirname}/../../client/`; const app = express(); app.disable('x-powered-by'); -app.use('/docs', require('./docs/server')); +app.use('/docs', require('./docs')); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json({