slushjs / slush-angular

A slush generator for AngularJS using the Google Angular App Structure Recommendations
129 stars 32 forks source link

Replace gulp-serve with gulp-webserver for proxies #39

Open stubbies opened 9 years ago

stubbies commented 9 years ago

As far as I know gulp-serve has no option for setting proxies which makes it complicated if your backend uses a different port and you run into CORS issues. With gulp-webserver you can set proxies, what do you think?

joakimbeng commented 9 years ago

Sorry for the slow response...

It sounds good to me! I haven't tried gulp-webserver myself but I'm willing to accept a PR which replaces gulp-serve :)

reflexdemon commented 9 years ago

What about using gulp-connect to enable proxies? I have tried in my personal project with proxies.

https://github.com/reflexdemon/ng-gulp/blob/master/gulpfile.js#L24-L30 and https://github.com/reflexdemon/ng-gulp/blob/master/gulpfile.js#L186-L200

I think I will open a PR for this with gulp-connect as soon as I find time.

stubbies commented 9 years ago

@reflexdemon does it uses preflight request OPTIONS?

reflexdemon commented 9 years ago

Yes. We can do that with headers I believe. Please checkout these lines to set headers. https://github.com/reflexdemon/ng-gulp/blob/master/gulpfile.js#L27-L29

reflexdemon commented 9 years ago

@Errvald https://github.com/slushjs/slush-angular/pull/44 has been opened for this. This the first time I am working on slush and JS. Please take liberty to test and let me know if out find any issues. I am coming from pure JAVA background and this is just my first try on the JS side of the world.

stubbies commented 9 years ago

@reflexdemon livereload seems to be broken for me.

reflexdemon commented 9 years ago

My middleware server had issues when livereload was restarting. So I had disabled it with proxies. let me see, if I get a hack to fix this and keep you posted.

reflexdemon commented 9 years ago

@Errvald I got the livereload working on my project and will make the needed changes on the template and push it in couple of days.

Meanwhile here is a sample of working livereload. https://github.com/reflexdemon/ng-gulp/blob/master/gulpfile.js

reflexdemon commented 9 years ago

https://github.com/slushjs/slush-angular/pull/44 now has livereload