How to connect your MySQL database to your NodeJS application? It’s very simple. Don’t believe me? Here’s how you can do it.
First, create a folder in your Node application direction named config. Now, this can be of any name of your preference.
Inside this folder, create a file named database.js. This file will contain our database configuration and connection.
Now, there are 2 ways in which you can create a database connection in NodeJS. The simple connection and a pool connection. I prefer the latter because of a few reasons which I am going to explain later.
What is street photography?
For me, street photography is all about capturing simple moments and finding a story in it. Just take a walk with your camera or smartphone, feel the vibe of a particular moment and press the shutter.
In this story, I want to share my experience about street photography in Mumbai, India.
I came to Mumbai a year and a half back and I instantly fell in love with the city. The fast paced life here is what I always craved for. People are not concerned about who you are or what you do. You can be…
This is a detailed explanation of a basic NodeJS application configuration file.
One of the most confusing things we face while stepping into the world of API’s is how to configure our application. In this tutorial, we will be going through a basic application configuration which will help us to understand about the basics.
Usually we find some boiler plate or use express generator to help us ease the pain to create a configuration file from scratch. But it is necessary to understand what it does before diving into building API’s. So, we will create one from scratch.
Before starting with the basic setup for NodeJS, first we need to know what is it and why we are using it.
NodeJS installation :
Full stack developer