mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-22 21:52:11 +00: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
fc3d98d23a
commit
ff06f368de
3 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -41,5 +41,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