create-mern-omar 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/index.js +56 -25
- package/package.json +8 -9
- package/templates/.env.example +2 -0
- package/templates/.gitignore.template +2 -0
- package/templates/controllers/index.routes.js +10 -0
- package/templates/db/index.js +1 -0
- package/templates/models/User.js +26 -0
- package/templates/server.js +7 -8
- package/templates/package-lock.json +0 -1116
- package/templates/package.json +0 -19
- package/test-proj/db/index.js +0 -15
- package/test-proj/package-lock.json +0 -1116
- package/test-proj/package.json +0 -19
- package/test-proj/server.js +0 -55
package/templates/package.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "templates",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"main": "server.js",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"start": "node server.js",
|
|
8
|
-
"dev": "nodemon server.js"
|
|
9
|
-
},
|
|
10
|
-
"author": "",
|
|
11
|
-
"license": "ISC",
|
|
12
|
-
"description": "",
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"dotenv": "^17.2.3",
|
|
15
|
-
"express": "^5.2.1",
|
|
16
|
-
"mongoose": "^9.0.2",
|
|
17
|
-
"morgan": "^1.10.1"
|
|
18
|
-
}
|
|
19
|
-
}
|
package/test-proj/db/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose") // importing mongoose
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
async function conntectToDB(){ //connection to the database
|
|
5
|
-
try{
|
|
6
|
-
await mongoose.connect(process.env.MONGODB_URI)
|
|
7
|
-
console.log("Connected to Database")
|
|
8
|
-
}
|
|
9
|
-
catch(error){
|
|
10
|
-
console.log("Error Occured",error)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
module.exports = conntectToDB
|