How do I name the .bowerrc file?

on the command line (make sure to cd into your working directory), issue this command: touch .bowerrc This will also work for other files common to webdev like .htaccess and .gitignore Note: If you haven’t installed git bash for windows, you may not have support for the touch command. In that case (as mentioned in … Read more

Want to get crystal clear about NodeJS app structure (Full JavaScript Stack) [closed]

Alright, this is a pretty broad question and I’m definitely no expert, but I’ll do my best here. TL;DR routes are controllers that tell what logic to execute when a user navigates their browser to a certain path within your app, including which views to render and what data to send to those views models … Read more

io.on(‘connection’,…) vs io.sockets.on(‘connection’,…)

The default namespace that Socket.IO clients connect to by default is: /. It is identified by io.sockets or simply io (docs). This example copied from the documentation: // the following two will emit to all the sockets connected to `/` io.sockets.emit(‘hi’, ‘everyone’); io.emit(‘hi’, ‘everyone’); // short form I assume it is the same for ‘on’, … Read more

MongoDB – Error: invalid schema, expected mongodb

This is because you are using the connection string in an improper format. You are using localhost:27017/db/chat while it should be mongodb://localhost:27017/db/chat The pattern for the connection string is mongodb://<HOSTNAME>:<PORT>/<DBNAME> Article for reference: https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect

Logging stdout and stderr of Node

What about this? console.log(“I will goto the STDOUT”); console.error(“I will goto the STDERR”); Note: both of these functions automatically add new line to your input. If you don’t want those newlines appended to your input, do this process.stdout.write(“I will goto the STDOUT”) process.stderr.write(“I will goto the STDERR”) Both process.stdout and process.stderr are streams, so you … Read more