mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
Add serving of static assets under the relative URL '/public'
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
0c2900d1c0
commit
af106fdf50
3 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -40,5 +40,6 @@ dist
|
|||
|
||||
public/uploads/*
|
||||
!public/uploads/.gitkeep
|
||||
!public/.gitkeep
|
||||
uploads
|
||||
test_uploads
|
||||
|
|
0
public/.gitkeep
Normal file
0
public/.gitkeep
Normal file
|
@ -55,6 +55,13 @@ async function bootstrap(): Promise<void> {
|
|||
prefix: '/uploads/',
|
||||
});
|
||||
}
|
||||
logger.log(
|
||||
`Serving the local folder 'public' under '/public'`,
|
||||
'AppBootstrap',
|
||||
);
|
||||
app.useStaticAssets('public', {
|
||||
prefix: '/public/',
|
||||
});
|
||||
await app.listen(appConfig.port);
|
||||
logger.log(`Listening on port ${appConfig.port}`, 'AppBootstrap');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue