mirror of
https://github.com/rjNemo/MERN_sample_app
synced 2026-06-06 08:46:39 +00:00
sets conditionnal db UIR
This commit is contained in:
parent
6d70937096
commit
9e26eff3c8
1 changed files with 3 additions and 2 deletions
|
|
@ -3,7 +3,6 @@ import mongoose from "mongoose";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import helmet from "helmet";
|
import helmet from "helmet";
|
||||||
// import { MONGO_URI } from "./config/keys.js";
|
|
||||||
import items from "./routes/api/items.js";
|
import items from "./routes/api/items.js";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
@ -11,7 +10,9 @@ const app = express();
|
||||||
// http port
|
// http port
|
||||||
const PORT = process.env.PORT || 5000;
|
const PORT = process.env.PORT || 5000;
|
||||||
// database connection key
|
// database connection key
|
||||||
const db = process.env.MONGO_URI; // || MONGO_URI;
|
const db =
|
||||||
|
process.env.MONGO_URI ||
|
||||||
|
"mongodb+srv://ruidy:Xyxoo971+mongodb@projectscluster-xcfet.mongodb.net/test?retryWrites=true&w=majority";
|
||||||
|
|
||||||
// connection to database
|
// connection to database
|
||||||
mongoose
|
mongoose
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue