I am getting a TypeError in my variable assignment for mongodb connection. Is there a workaround for this? //server.js var mongoose = require('mongoose'); var config = require('./config'); var { db: {user,pass,host,port,name } } = config; var connectionString = `mongodb://${user}:${pass}@${host}:${port}/${name}`; mongoose.connect(connectionString, { useMongoClient: true }); Error C:\mean\webguidv1\server.js:65 ...
Discy Latest Questions
I am trying to use ng2-datetime. However, when I follow the instruction and installed npm install –save ng2-datetime, I get the following error. I have tried running the following npm install but it doesnt fix ...
I use this package. I’ve added these console.log‘s at the beginning of the slug function. function slug(string, opts) { console.log('log 1: -------'); console.log('log 2: ' + string); console.log('log 3: ...
I’ve seen similar questions that were asked here but none matches my situation. In my web I have 3 JavaScript files : client.js , server.js ,myModule.js . In client.js I create a window variable called windowVar and I add to ...
I have developed an angular 7 app with express backend. Express running on localhost:3000 and angular client is running on localhost:4200. In the server.js I have (not the entire code) const app = express(); // Enable CORS app.use(cors()); // Get our API routes const api = ...
I am trying to compile a project on Windows 10 in Visual Studio Code, my settings are the following: 1) npm version 6.12 2) Node.js version 12.13 3) Angular CLI: 8.3.19 The problem I have is as soon as I try to run ng ...
I am trying to create a fullstack app reading the following tutorial: https://medium.com/javascript-in-plain-english/full-stack-mongodb-react-node-js-express-js-in-one-simple-app-6cc8ed6de274 I followed all steps and then tried to run: node server.js But I got the following error: MongoDB connection error: MongoTimeoutError: Server selection timed out after 30000 ms