I'm currently working on a project that utilizes loopback for the backend and Angular for the frontend. My client side was set up with gulp-angular, and I added lb-services.js from loopback. The issue I am facing is that my Angular application is attempting to send requests to the API on the same port where I have gulp serve running. Loopback is on port 3000 while Angular runs on port 3001.
Is there a way to instruct Angular to use a different port when making requests to the API?
I attempted to modify the gulp server.js like so:
browserSync.instance = browserSync.init({
startPath: '/',
server: server,
browser: browser,
port:4000
});
However, this configuration results in both Angular and its API requests running on port 4000. Here's what it looks like:
Angular running on:
http://localhost:4000/
Requesting data from loopback server:
http://localhost:4000/api/People
What I actually want is this:
Angular running on:
http://localhost:4000/
Requesting data from loopback server:
http://localhost:3000/api/People
Any suggestions on how to accomplish this task would be greatly appreciated!