Create your Node.js application
Next, create a simple Node.js application that can be deployed to the Cloud. This tutorial uses an application generator to quickly scaffold out the application from a terminal.
Install the Express generator
Express is an extremely popular framework for building and running Node.js applications. You can scaffold (create) a new
Express application using the Express Generator tool. The Express Generator is shipped as an npm module and installed by using the npm command-line tool
$ npm install -g express-generator
-g switch installs the Express Generator globally on your machine so you can run it from anywhere.
Scaffold a new application
Next, scaffold a new Express application called
myExpressApp by running:
$ express myExpressApp --view pug --git
--view pug --git parameters tell the generator to use the pug template engine (formerly
jade) and to create a
To install all of the application's dependencies, go to the new folder and run
$ cd myExpressApp $ npm install
Run the application
Last, let's ensure that the application runs. From the terminal, start the application using the
npm start command to start the server.
$ npm start
Now, open your browser and navigate to http://localhost:3000, where you should see something like this:
Next, open your application folder in VS Code and get ready to deploy it to Azure.
$ code .