┣ 📂public
┣ 📂src
┃ ┣ 📂Data
┃ ┃ ┗ 📜data.js
┃ ┣ 📂Routes
┃ ┃ ┗ 📜posts.js
┃ ┣ 📂views
┃ ┃ ┣ 📂pages
┃ ┃ ┃ ┣ 📜index.css
┃ ┃ ┃ ┣ 📜index.ejs
┃ ┃ ┃ ┗ 📜log.jpeg
┃ ┃ ┣ 📂public
┃ ┃ ┃ ┗ 📜index.css
┃ ┃ ┗ 📜.DS_Store
┃ ┣ 📜.DS_Store
┃ ┗ 📜hello.js
┣ 📜.DS_Store
┣ 📜.babelrc
┣ 📜.gitignore
┣ 📜Readme.md
┣ 📜index.js
┣ 📜nodemon.json
┣ 📜now.json
┣ 📜package-lock.json
┣ 📜package.json
┗ 📜vercel.json
Navigate the cursor to the file I will create the project in the terminal and I am creating the package.json file with the following command:
npm init --y
npm install express cors morgan body-parser dotenv
npm install @babel/core @babel/node @babel/preset-env
{
“presets”: [“@babel/preset-env”]
}
"start": "nodemon — exec babel-node src/index.js"
sudo npm install -g nodemon
Firstly, let’s install two modules that are necessary for documentation and user interface (UI):
npm install swagger-jsdoc swagger-ui-express
import swaggerUI from “swagger-ui-express”;
import swaggerJsDoc from “swagger-jsdoc”;