nestjs / serve-static

Serve static websites (SPA's) using Nest framework (node.js) šŸ„¦

Home Page:https://nestjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get dynamic path

calebeaires opened this issue Ā· comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

In some cases there is subfolders that is created dynamic. An example is a control for app based on a number.

Describe the solution you'd like

Using path routers to represent the path

        ServeStaticModule.forRoot({
            rootPath: join(__dirname, '..', 'content', 'app', ':app_ID', 'assets'),
            serveRoot: '/content/assets/:app_ID'
        }),

What is the motivation / use case for changing the behavior?

app_ID here represents the dynamic route. Give the user the choice to better represent files in some context, like control user or app files