2017-12-17 01:41:22 +09:00
|
|
|
/**
|
|
|
|
* Docs Server
|
|
|
|
*/
|
|
|
|
|
|
|
|
import * as express from 'express';
|
|
|
|
|
2018-03-29 20:50:45 +09:00
|
|
|
const docs = `${__dirname}/../../client/docs/`;
|
|
|
|
|
2017-12-17 01:41:22 +09:00
|
|
|
/**
|
|
|
|
* Init app
|
|
|
|
*/
|
|
|
|
const app = express();
|
|
|
|
app.disable('x-powered-by');
|
|
|
|
|
2018-03-29 20:50:45 +09:00
|
|
|
app.use('/assets', express.static(`${docs}/assets`));
|
2017-12-17 01:41:22 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Routing
|
|
|
|
*/
|
|
|
|
app.get(/^\/([a-z_\-\/]+?)$/, (req, res) =>
|
2018-03-29 20:50:45 +09:00
|
|
|
res.sendFile(`${docs}/${req.params[0]}.html`));
|
2017-12-17 01:41:22 +09:00
|
|
|
|
|
|
|
module.exports = app;
|