mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-12-18 04:44:27 +00:00
21 lines
420 B
TypeScript
21 lines
420 B
TypeScript
/**
|
|
* 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;
|