Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/naporin0624/nest-spa-serve
- Owner: naporin0624
- License: mit
- Created: 2020-03-28T12:36:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T18:15:29.000Z (over 1 year ago)
- Last Synced: 2024-10-04T22:17:57.827Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 {}
```