I have a LoopBackJS Restful server running at: localhost:3000.
At front-end side, I have a simple Angular 2 app that consumes the above APIs.
Everything is working fine when:
- Using nodemon to run the server (root folder at my-service/api)
- Using npm start to run the client side (root folder at my-service/client)
I can do localhost:4200 to access my app which consumes the APIs running at localhost:3000 as mentioned above.
Now I built the Angular app using 'ng build --prod' and pointed the output 'dist' folder inside the server directory (my-service/api/dist). I've configured the server code to work this way.
Next I accessed my app using http://localhost:3000 because everything is static files now. Everything seem to be working only if I don't refresh the browser. The error:
Error 404 Cannot GET /lics status: 404 Error: Cannot GET /lics at raiseUrlNotFoundError
What happened and how do I fix this? Thanks.