The_Brink The_Brink - 1 month ago 14
AngularJS Question

loading index.html with node.js and receiving data from the client side in AngularJS

Okay, first off, I am build a web app using AngularJS and node.js. I have the AngularJS part down pretty good, but I can't seem to get the server side working how I want it to. I am using the angular-seed at github ( https://github.com/angular/angular-seed ) for my project. The project is setup with the web-server.js being in the scripts folder and the index.html is in the app folder. If you need to see what the web-server.js code looks like just go to https://github.com/angular/angular-seed/blob/master/scripts/web-server.js


  • How can I get the web-server.js, using node.js, to use the index.html file at localhost:3000 instead of the root directory of the web app?

  • How can I, on the server side, send and receive data to the angular side?


Answer Source

Here is a github project created explicitly for people who are the same boat as you.

https://github.com/ganarajpr/express-angular

If you dont want all those things ( Bootstrap / OAuth ) you could go with something simpler like https://github.com/btford/angular-express-seed ( which is the inspiration for express-angular ).

Hope this helps.