Skip to content

Commit 1ad649b

Browse files
authored
Merge pull request #265 from dump-hr/origin/fix
Maybe fix
2 parents 4705fda + 6727fd7 commit 1ad649b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

apps/api/src/app.module.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ import { TestSlotModule } from './test-slot/test-slot.module';
1818

1919
@Module({
2020
imports: [
21-
ServeStaticModule.forRoot({
22-
rootPath: join(__dirname, '..', '..', '..', 'web', 'dist', 'assets'),
23-
serveRoot: '/assets',
24-
exclude: ['/api/(.*)'],
25-
}),
26-
2721
ServeStaticModule.forRoot({
2822
rootPath: join(__dirname, '..', '..', '..', 'web', 'dist'),
23+
serveRoot: '/',
2924
exclude: ['/api/(.*)'],
25+
serveStaticOptions: {
26+
setHeaders: (res, path) => {
27+
if (path.endsWith('.css')) res.setHeader('Content-Type', 'text/css');
28+
if (path.endsWith('.js'))
29+
res.setHeader('Content-Type', 'application/javascript');
30+
},
31+
},
3032
}),
3133
LoggerModule,
3234
InternModule,

0 commit comments

Comments
 (0)