Node.js
Basics¶
![[Screenshot 2025-03-24 at 4.08.27 AM.png]]
Basics¶
- the global object
- modules & require
- node & the file system (creating, reading, deleting files etc)
- streams & buffers
Clients & Servers¶
- clients & servers
- ip addresses & domains
- When you type a website name, your computer looks up its IP address to find and connect to the right server.
- creating a server
- localhost & port numbers
- deployment = taking your app from your local machine (localhost) and putting it on a remote server so others on the internet can access it.
Requests & Responses¶
- request object
- response object
- returning html pages
- basic routing
- status codes
- redirects
npm¶
- 3rd party packages
- installing packages globally (nodemon)
- the package.json file & installing packages locally
- dependencies & sharing code
Express Apps¶
- what is express?
- creating an express app
- routing & html pages
- redirects & 404 pages
View Engines¶
- view engines at a glance
- ejs view engine
- passing data into views
- partials
Middleware¶
- what is middleware? ![[Screenshot 2025-03-24 at 4.11.09 AM.png]]
- using next( )
- 3rd party middleware
- static files
Database¶
https://chatgpt.com/share/67e109cd-c5e8-8005-b325-afa967e10f41
-
Mongoose and Prisma help you interact with your database using code instead of raw queries—Mongoose is for MongoDB, Prisma is mostly for SQL.
-
Host the DB on Atlas,
- Connect to it from your backend via URI,
- Write data either with your backend or GUI,
- Use it like a boss.
CRUD¶
Express Router & MVC¶
- express router
- mvc basics
- controllers
- RequestHandler