How to create a local Server 10 lines of Express
First you need to make a directory to hold your server files and make it your working directory, assuming you’ve already installed Node.js.
Second you need to initialize a package.json file for your application by using the npm init command check package.json for more information.
Third install Express in the server-app directory and save it in the dependencies list.
Now inside of the main file that we created earlier we will start working on making an Express server by requiring express and invoking it.
Now we need to use the GET method so when a request is made to the root URL (/) we will respond with a message.
Here we need to make our app listen to port 3000 so the server can make a connection and start.
Last we need to run the node on app.js command to start our server
http://localhost:3000/ in a browser to see the output.
That’s it people we are done and we have a running server uh oh 7 lines. Now lets get this app out in the wild, out onto the Internet quickly with Heroku.