blob: 889532e17e4c438cdff1deaf1640b4f95cff00fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/**
* Docs Server
*/
import * as path from 'path';
import * as express from 'express';
const docs = path.resolve(`${__dirname}/../../client/docs/`);
/**
* Init app
*/
const app = express();
app.disable('x-powered-by');
app.use('/assets', express.static(`${docs}/assets`));
/**
* Routing
*/
app.get(/^\/([a-z_\-\/]+?)$/, (req, res) =>
res.sendFile(`${docs}/${req.params[0]}.html`));
module.exports = app;
|