1.1.0 • Published 4 years ago
nest-spa-serve v1.1.0
Nest-SPA-Serve
Single Page Application delivery server module for NestJS
Usage
import { Module } from "@nestjs/common";
import { SPAClientModule } from "nest-spa-serve";
import { join } from "path";
import config from "../webpack.config";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
@Module({
imports: [
SPAClientModule.forRoot({
// URL path where the SPA is provided
renderPath: "/",
// Directory of static file (index.html)
rootPath: join(process.cwd(), "public"),
// webpack.config.js for frontend
webpackConfig: config,
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}