Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/naporin0624/nest-spa-serve

Single Page Application delivery server module for NestJS
https://github.com/naporin0624/nest-spa-serve

Last synced: 23 days ago
JSON representation

Single Page Application delivery server module for NestJS

Awesome Lists containing this project

README

        

# Nest-SPA-Serve

Single Page Application delivery server module for NestJS

## Usage

```typescript:app.module.ts
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 {}
```