Open ghost opened 10 years ago
Yes, I agree.
I'm not an expert but stil lwant to help. This is how I made it work:
First, understand that a server of some kind has to serve guthub. (I got confused by the mentioning of Mongolab as I assumed that it will serve this app. But I got Error 404, no matter what I tried.)
Then I found web-server.js which seems to be just that, a web-server, with our one recipe for the Cookies hard coded. I also glanced at chapter 3 again. And finally this is what i did to make it work:
I think there are many ways of doing this, yeoman seems to be one, but I used git, npm and node since I already had them installed and understand what they do.
In cmd I run: $ git clone https://github.com/shyamseshadri/angularjs-book.git (to get my own copy of it all) $ cd angularjs-book/chapter4/guthub (to get to where the web-server.js file is, and the rest of the code for guthub) $ npm install (npm stands for node packet manager, this installs all stuff / dependencies needed. I got one warning and ignored it) $ node node web-server.js (if all is well the server will start and listen at port 8080, open a browser and go to http://localhost:8080/)
I hope this helps.
That worked thanks. Really usefull... The book could have made it clearer especially as in the previous chapter it was using grunt server
although your final command should have been: $ node web-server.js
You've absolutely mnade my day with this explanation. Just been running through my best list of expletives for O'Reilly, but this exonerates everything wrong with that book. Let's hope O'Reilly does the decent thing and links to this page.
Also, that last command should be nodejs web-server.js
And since we seem to be providing the full-on A-Z of getting this code example up, we could add:
$ Navigate to http://localhost:8080/ in your browser to view the wonderful app!
Oh and thanks a million for the help guys!
For beginners it is probably unclear how to serve these files, especially if skipping around in the book. The readme should have links to installing node, using NPM install and running a node web server.