https://github.com/zntb/express-starting-server
Express Project Starting Setup Code - main branch=Setup for Common JS, another branch=Setup for ES Modules.
https://github.com/zntb/express-starting-server
Last synced: 11 months ago
JSON representation
Express Project Starting Setup Code - main branch=Setup for Common JS, another branch=Setup for ES Modules.
- Host: GitHub
- URL: https://github.com/zntb/express-starting-server
- Owner: zntb
- Created: 2024-02-14T17:44:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T05:18:12.000Z (over 1 year ago)
- Last Synced: 2025-01-04T15:49:34.625Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
First create a package.json file:
```
npm init -y
```
Installed Packages:
```
npm i --save express
npm i --save-dev nodemon
npm i colors
npm i dotenv --save-dev
npm i morgan
```
❗Add the .env file to gitignore❗
package.json setup modification in ES Modules:
```
{
"name": "express-starting-server",
"version": "1.0.0",
"description": "",
"main": "app.js",
"type": "module" 👈 ❗This should be added❗
"scripts": {
"start": "nodemon app.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"colors": "^1.4.0",
"express": "^4.18.2",
"morgan": "^1.10.0"
},
"devDependencies": {
"dotenv": "^16.4.4",
"nodemon": "^3.0.3"
}
}
```