Create a project folder and basic setup by doing the following:
mkdir myblog
cd myblog
npm init -y
Now is the best time to initialize git!
git init
git add .
git commit -m 'init commit'
package.json
as a file in your folder.index.js
and .env
Now you'll install some npm modules that you'll need for this app:
npm i express dotenv
npm i -D nodemon
express is a framework for building API's and web applications
dotenv loads the .env
into system variables - used to keep them secret
nodemon restarts the server when it detects changes in our code files so we don't have to.
-D
in this command saves this as a dev dependency - it won't be used when the server is eventually deployedAdd your personal variables to the .env
file: