Define IDE
Integrated development environment.
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools and a debugger.
How do you start writing a node application so that you can keep track of all dependencies?
With the command:
‘npm init’
How do you install express?
npm install –save express
What steps are needed to start the most basic express app?
How do you stop the server, or Mongod in the terminal?
ctrl + c
How do you define a schema with mongoose?
var newSchema = new mongoose.Schema({
completed: {
type: Boolean,
default: false
});How do you declare a mongoose model?
var Todo = mongoose.model(‘Todo’, todoSchema);
How do you export things out of a js file while using node.js?
Use:
module.exports = (thing-to-export)
How do you start a MongoDB?
./mongod
In the root directory, and leave it running.
How do you get ‘/api/todos’ in front of all of your routes?
app. use(‘/api/todos’, todoRoutes);
* This will put that prefix in front of all of them.
How do you gain the ability to reference the body?
How do you get things out of the GET request?
router.get(‘/:todoID’, function(req, res){
db.Todo.findById(req.params.todoID);
})
Name the 7 routes
What’s the route, URL and HTTP Verb to display a list of all blogs?
Index
/blogs
GET
What’s the route, URL and HTTP Verb to show a form to make new blogs?
New
/blog/new
GET
What’s the route, URL and HTTP Verb to add a new blog to database, then redirect?
Create
/blogs
POST
What’s the route, URL and HTTP Verb to show info about one blog?
Show
/blogs/:id
GET
What’s the route, URL and HTTP Verb to show an edit form of one blog?
Edit
/blogs/:id/edit
GET
What’s the route, URL and HTTP Verb to update a particular blog, then redirect?
Update
/blogs/:id
PUT
What’s the route, URL and HTTP Verb to delete a particular blog, then redirect?
Destroy
/blogs/:id
DELETE