4

I'm building a react single page application using for backend, loopback.

How can I set, in the middleware, all the traffic (except API calls to the server and asset files like css, js,...) to go to index.html?

Here is what I have for the moment in my middleware.json configuration for the files page.:

"files": {
        "loopback#static": [
            {
                "paths": [
                    "/storage"
                ],
                "params": "$!../storage"
            },

            {
                "paths": [
                    "/*"
                ],
                "params": "$!../client/index.html"
            },
            {
                "paths": [
                    "/*.*"
                ],
                "params": "$!../client"
            }
        ]
    },

At the moment, it seems like all traffic is indeed redirected to index.html but so are the css, js, ...

Any ideas?

denislexic
  • 10,786
  • 23
  • 84
  • 128

0 Answers0