fix bug
This commit is contained in:
parent
0484976afa
commit
4786214e2a
2 changed files with 31 additions and 7 deletions
|
@ -23,6 +23,7 @@ const _filename = __filename;
|
|||
const _dirname = dirname(_filename);
|
||||
|
||||
const staticAssets = `${_dirname}/../../../assets/`;
|
||||
const clientAssets = `${_dirname}/../../../../client/assets/`;
|
||||
const assets = `${_dirname}/../../../../../built/_client_dist_/`;
|
||||
|
||||
// Init app
|
||||
|
@ -59,6 +60,13 @@ router.get('/static-assets/(.*)', async ctx => {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/client-assets/(.*)', async ctx => {
|
||||
await send(ctx as any, ctx.path.replace('/client-assets/', ''), {
|
||||
root: clientAssets,
|
||||
maxage: ms('7 days'),
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/assets/(.*)', async ctx => {
|
||||
await send(ctx as any, ctx.path.replace('/assets/', ''), {
|
||||
root: assets,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue