Agenda
Project Structure
Routing Requests
Routes with Express.js
POST Requests with Express.js
Node.js Project Structure
Wendi's Web - Node.JS: Basic Project Structure
Review:
- public_html is available to the public (hence the name)
- anyone who knows the domain name can visit the contents of the public_html directory
- you don’t want node.js projects here (do you want potential hackers seeing your code??)
Node.js projects should NOT go in the public_html directory
- that’s why we created /nodeapps (or whatever you used) in the parent of public_html
Node.js apps have a different structure that you’re used to for web applications and web sites
recall:
Basic Routing with Node.js
Wendi's Web - Node.JS: Routing Requests
route = how an app should respond to a request to a specific url
- an app would route a request to a home page differently than it would route a request to submit login credentials