blob: a546d1e88c2501eb45a1edc82d1c4cca7a3210d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/**
* Docs
*/
import * as path from 'path';
import * as Router from 'koa-router';
import * as send from 'koa-send';
const docs = path.resolve(`${__dirname}/../../client/docs/`);
const router = new Router();
router.get('/assets', async ctx => {
await send(ctx, `${docs}/assets`);
});
router.get(/^\/([a-z_\-\/]+?)$/, async ctx => {
await send(ctx, `${docs}/${ctx.params[0]}.html`);
});
module.exports = router;
|