Setting up the Start Scripts and Running the Server
Learn how to start up the server for any project.
Previously, we set up our backend’s structure and architecture and installed all the necessary npm
packages. To start our Node.js application in this lesson, we need to require the Express framework in our server.js
file. However, before we do that, let us set up the server port.
Setting up the port
Inside our .env
file, we configured our server to run on port 5000
, which means we’ll create a variable in our server.js
file to have access to this port. Following is how we do ...