$ bash lab5/check-setup.sh
I got the error
bash: lab5/check-setup.sh: No such file or directory
Make sure you're in your 'introHCI' directory and that you've cloned lab5 here.
$ bash lab5/check-setup.sh
What's the vagrant password?
vagrant
var data = require('../data.json');
$ node app.js
Express server listening on port 3000
When I try to run node app.js
I get a bunch of error messages, including the line
Error: listen EADDRINUSE
This probably happened because Node crashed. For instance, Vagrant might have disconnected you all of a sudden.
To fix this problem, tell your browser to refresh http://localhost:3000 until you get "No data received" or a similar message. Now try starting Node again. Everything should be fine.
Explanation: The message EADDRINUSE
means that Node can't start listening on port 3000 because it's already in use. The problem is that the last instance of Node failed to properly release port 3000 when it crashed. By refreshing the webpage, we're getting the OS to realize 'Oh, the Node server isn't using port 3000 anymore' and consequently release it.
I get a blank page!
Make sure node is running (see previous slide).
I can't load the Javascript at public/js
Files in your /public directory are aliased to root. (HUH?) Suppose you have public/foo.js and you want to import it. Then it would be at localhost:3000/foo.js
<div class="container">
When I click on the name, it says that it can't find an anagram for that name.
The most common cause here is that your click listener is not listening to the right element. For example, if you put the click listener on the entire div, when you call text(), it will return a bunch of whitespace around the name, and it won't match our list of anagram keys. Make sure you're selecting only the element that actually has the text inside of it.
git status
git add ...
git commit -m "putting it together lab"
git push
heroku create newapplicationname
git push heroku master