3. Create and run a local Node.js app from Visual Studio Code

Clone the Express.js sample application then run the application locally.

Create a local Express.js app

Create and run an Express.js app by cloning an Azure sample repository.

  1. At a terminal command prompt, go to the directory location where you want to create the app folder.

  2. Use the following bash command with git to clone the repository, change into the repository folder named myexpressapp, then install the npm dependencies.

    git clone https://github.com/Azure-Samples/js-e2e-express-server.git myexpressapp && \
        cd myexpressapp && \
        npm install
    

Run your local Express.js app

  1. Start the server:

    npm start
    
  2. Test the app by opening a browser to http://localhost:3000. The site should appear as follows:

    Browser screenshot displaying Express.js app.

  3. Press Ctrl + c in the terminal to stop the server.

Next steps