Closed ChrisWorks closed 7 years ago
I solved this by creating a proxy for WebPack
To begin, create a new file in your client root:
proxy.config.json
{
"/socket.io/": {
"target": "http://localhost:1337",
"secure": false,
"logLevel": "debug",
"ws": true
}
}
Edit package.json and update the "start" property in the "scripts" tree
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
Now start your Angular-CLI app using
npm start
That fixed it! Thanks.
I have created a basic angular2 app using the angular-cli and installed angular2-sails and socket.io-client. My sails application is running at localhost 1338.
When running my angular2 app I am getting a 404 error:
GET http://localhost:4200/socket.io/?__sails_io_sdk_version=0.13.5&__sails_io_s…owser&__sails_io_sdk_language=javascript&EIO=3&transport=polling&t=LjIO6bs 404
My backend authentication service is calling the sails service:
I am not sure if there is a config issue or build issue.
My angular-cli.json looks like this:
My packpage.json is:
Anyone know where I am going wrong?