feat: Serve frontend static files from backend

This commit is contained in:
Aleksi Lassila
2024-03-26 12:55:57 +02:00
parent 8a947d5831
commit b29907c0e2
5 changed files with 44 additions and 1 deletions

View File

@@ -4,9 +4,18 @@ import { AppService } from './app.service';
import { DatabaseModule } from './database/database.module';
import { UserModule } from './user/user.module';
import { AuthModule } from './auth/auth.module';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
@Module({
imports: [DatabaseModule, UserModule, AuthModule],
imports: [
DatabaseModule,
UserModule,
AuthModule,
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', '..', 'dist'),
}),
],
controllers: [AppController],
providers: [AppService],
})