Skip to content

Commit 5c5d93e

Browse files
Merge pull request #1178 from pzubar/serve-static-module-notice
docs(@nestjs/serve-static) update serve-static module description
2 parents 3ee09b7 + 157a339 commit 5c5d93e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

content/recipes/serve-static.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ export class AppModule {}
3535

3636
With this in place, build the static website and place its content in the location specified by the `rootPath` property.
3737

38+
#### Configuration
39+
40+
[ServeStaticModule](https://github.com/nestjs/serve-static) can be configured with a variety of options to customize its behavior.
41+
You can set the path to render your static app, specify excluded paths, enable or disable setting Cache-Control response header, etc. See the full list of options [here](https://github.com/nestjs/serve-static/blob/master/lib/interfaces/serve-static-options.interface.ts).
42+
43+
> warning **Notice** The default `renderPath` of the Static App is `*` (all paths), and the module will send "index.html" files in response.
44+
> It lets you create Client-Side routing for your SPA. Paths, specified in your controllers will fallback to the server.
45+
> You can change this behavior setting `serveRoot`, `renderPath` combining them with other options.
46+
3847
#### Summary
3948

4049
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/24-serve-static).

0 commit comments

Comments
 (0)