ydev-mern 1.0.2 → 1.0.3

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.
@@ -14,7 +14,9 @@
14
14
  "cors": "^2.8.6",
15
15
  "dotenv": "^17.4.2",
16
16
  "express": "^5.2.1",
17
- "mongoose": "^9.9.5",
17
+ "mongoose": "^9.9.5"
18
+ },
19
+ "devDependencies": {
18
20
  "nodemon": "^3.1.14"
19
21
  }
20
22
  }
@@ -1,15 +1,17 @@
1
1
  import express from "express";
2
- import { connectdb } from "../db.js";
2
+ import cors from "cors";
3
+ import { connectdb } from "./db.js";
3
4
 
4
5
  const app = express();
5
6
 
7
+ app.use(cors());
6
8
  app.use(express.json());
7
9
 
8
10
  app.get('/', (req, res) => {
9
11
  res.send("Backend is running");
10
- })
12
+ });
11
13
 
12
14
  app.listen(3000, () => {
13
15
  console.log("Server started on port 3000");
14
16
  connectdb();
15
- })
17
+ });
package/backend/src/db.js CHANGED
@@ -1,8 +1,8 @@
1
- import mongoose from "moongoose";
1
+ import mongoose from "mongoose";
2
2
  import 'dotenv/config';
3
3
  export const connectdb = async () => {
4
4
  try {
5
- const connection = await mongoose.connect(MONGO_URI);
5
+ const connection = await mongoose.connect(process.env.MONGO_URI);
6
6
 
7
7
  console.log("Mongodb connected");
8
8
  } catch (error) {
package/bin/cli.js CHANGED
@@ -42,7 +42,9 @@ function copyDirRecursive(src, dest) {
42
42
  if (
43
43
  entry.name === 'node_modules' ||
44
44
  entry.name === 'dist' ||
45
- entry.name === '.git'
45
+ entry.name === '.git' ||
46
+ entry.name === 'package-lock.json' ||
47
+ entry.name === '.DS_Store'
46
48
  ) {
47
49
  continue;
48
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydev-mern",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Full-stack MERN developer toolkit featuring modern React frontend and Express backend.",
5
5
  "main": "backend/src/Server.js",
6
6
  "type": "module",
@@ -9,7 +9,12 @@
9
9
  },
10
10
  "files": [
11
11
  "frontend",
12
+ "!frontend/package-lock.json",
13
+ "!frontend/node_modules",
14
+ "!frontend/dist",
12
15
  "backend",
16
+ "!backend/package-lock.json",
17
+ "!backend/node_modules",
13
18
  "bin",
14
19
  "README.md"
15
20
  ],