Experiment 14,15,16, 17 Out Put Process
Experiment 14,15,16, 17 Out Put Process
OUTPUT:
Experiment 15:
Types of Streams
npm init –y
Express follows the MVC (Model-View-Controller) pattern to organize code efficiently. This guide will
walk you through how to implement Models, Views, and Routes in an Express.js application using
MongoDB (Mongoose).
express-mvc-app/
│ ├── User.js
│ ├── userController.js
│ ├── userRoutes.js
│ ├── index.ejs
│ ├── db.js
│── package.json
Step:1
Open VSCODE--- create a new folder KK----select the folder myapp ---- In myapp folder create another
folder named as models.
Inside models folder create a file named as User.js
Step2:
Inside models folder create another folder named as views----- In views folder create a two files
1. newUser.ejs
2. users.ejs
Step 3:
Create another folder in myapp i.e., routes -- inside routes folder create a file userRoutes.js
Step 4:
Step 5:
Create app.js
Output: