After answering a few audience questions, Scott walks through the solution to exercise 12.
(dramatic music)…- [Man] Why do we have both an index.js file,…in the root directory as well as a server.js file,…in the server directory?…They both seem to be doing the same thing.…- Are they?…Let's take a look.…So, index.js, it's the entry point to our server.…What is it doing?…First thing it's doing is booting up the config,…which I think is very important, get that thing ready.…The second thing, it's requiring our app,…our server application.…
And then it's listening on the port,…and this is actually starting our server.…If we go look in server/server,…I don't see an app.listen in here,…so if they're the same thing, if I come in here…and I say node server/server, I get the database…it's seeded, that's great,…but the server didn't start up.…
And that's because it's in index.js.…And the reason we did that is,…because if you go back to when we were…talking about testing, yesterday, I needed to…export the app for testing.…That's why I have this comment down here,…export the app for testing.…So, because I had to export the app for testing,…
This course was created by Frontend Masters. It was originally released on 12/30/2015. We're pleased to host this training in our library.
- Executing Node.js
- Using Express
- What is middleware?
- Testing in Node.js
- Using Mongo with Node.js
- Data modeling
- Querying data with Mongoose
- Identifying sensitive routes
- Configuring the deployment
Skill Level Intermediate
Building a Slack Bot with Node.js Microserviceswith Daniel Khan2h 9m Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
2. REST APIs
5. Organization and Configuration
7. Data Modeling
10. Securing Routes
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.