Export
HTML-код
- Опубликовано: 10 фев 2025
- This video is for an Assignment where the students must take a poorly setup "table" into a simple website using #Node #Express #PostgreSQL and a cloud hosting provider (neon.tech)
I start off with how to export your own modules in NODE for people that have never done that before all the way to 2 of the 4 CRUD operations.
General
02:14 - Setup
02:40 - Make the file structure
Create and Import your own module
04:30 - Setting up the files for exporting
05:36 - Make your own module, import your first "file"
06:45 - "nodemon" - www.npmjs.com/...
07:40 - Creating and exporting a function in your module
09:35 - Run a function from the module
10:10 - Export multiple functions
Database
www.npmjs.com/...
15:20 - Making an account on Neon.tech
16:20 - Connection String
17:25 - Use existing Postgres code from Sample
20:00 - Setup the connection
21:00 - Alternate connection setup
22:38 - Run sequelize.authenticate() and sequelize.sync()
25:10 - Get some data from the Person Model
Express Routes
www.npmjs.com/...
27:00 - Setting up routes for express
29:00 - Just the routes...
30:47 - WATCH YOUR DIRECTORY STRUCTURE!
Express Server
www.npmjs.com/...
34:00 - Express Server for Localhost
35:48 - Express code
36:35 - Make Express use your ROUTES
EJS Templates
ejs.co/
38:37 - Sample Index.html
40:32 - EJS instead of HTML files
41:40 - How a template system works
43:15 - Setup Routes for EJS
44:12 - Set express to use EJS IMPORTANT
44:43 - How to send your object array to the index.ejs file
46:25 - Data on the page (Or not? Case Sensitive!)
Doing a DELETE
48:28 - Doing a DELETE using a button in the EJS template
51:50 - How to get the ID of the Person from the request parameters
52:00 - Show Delete working
Final Words
53:49 - Summary of what's left to do in the assignment
54:40 - Recap of all steps