Add comments to your projects.
Do this by adding a new schema and linking it to the project schema
newPost.save(afterSaving);
function afterSaving(err) { // this is a callback
if(err) {console.log(err); res.send(500); }
res.redirect('/');
}
$ bash lab7/check-setup.sh
I got the error
bash: lab7/check-setup.sh: No such file or directory
Make sure you're in your 'introHCI' directory and that you've cloned lab7 here.
$ sudo bash lab7/check-setup.sh
What's the vagrant password?
vagrant
When I run node app.js
I get the following error Error: failed to connect to [localhost:xxxxx]
Mongo isn't running! Did you remember to run the check-setup.sh
script?
I restarted the server, but nothing shows!
In index.js, add a console.log(projects) inside renderProjects. Is your data formatted correctly? Perhaps you need to change the schema. Don't forget to rerun node initDB.js after changing your schema.
I can't access res in my callback.
You need to declare the callback function within the projectInfo function to get access to res.
I console.log()ed the data and it looks correct, but wont render!
Hint:find() returns an array of results.
Doesn't work and I can't findout why!
In your callback, make sure there's a 'if (err) { console.log(err) }'. What does the console output say?
function deleteCallback(err) {
if(err) { console.log(err); }
...
}
Doesn't work and I can't findout why!
In your callback, make sure there's a 'if (err) { console.log(err) }'. What does the console output say?
function addCallback(err) {
if(err) { console.log(err); }
...
}
git status
git add ...
git commit -m "putting it together lab"
git push
heroku create newapplicationname
heroku addons:add mongolab
git push heroku master
heroku run node initDB.js