mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
StaticServe: Fix serving images under uploads/
This did not work until now, because path and prefix were swapped. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
698dd1a634
commit
ea4ccc76e4
1 changed files with 8 additions and 3 deletions
11
src/main.ts
11
src/main.ts
|
@ -13,6 +13,7 @@ import { AppConfig } from './config/app.config';
|
|||
import { MediaConfig } from './config/media.config';
|
||||
import { NestConsoleLoggerService } from './logger/nest-console-logger.service';
|
||||
import { setupPrivateApiDocs, setupPublicApiDocs } from './utils/swagger';
|
||||
import { BackendType } from './media/backends/backend-type.enum';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||
|
@ -35,9 +36,13 @@ async function bootstrap() {
|
|||
transform: true,
|
||||
}),
|
||||
);
|
||||
if (mediaConfig.backend.use === 'filesystem') {
|
||||
app.useStaticAssets('uploads', {
|
||||
prefix: mediaConfig.backend.filesystem.uploadPath,
|
||||
if (mediaConfig.backend.use === BackendType.FILESYSTEM) {
|
||||
logger.log(
|
||||
`Serving ${mediaConfig.backend.filesystem.uploadPath} under 'uploads/'`,
|
||||
'AppBootstrap',
|
||||
);
|
||||
app.useStaticAssets(mediaConfig.backend.filesystem.uploadPath, {
|
||||
prefix: '/uploads/',
|
||||
});
|
||||
}
|
||||
await app.listen(appConfig.port);
|
||||
|
|
Loading…
Reference in a new issue