Create your Node.js application
In this section, you will create a simple static website that can be deployed to the cloud. This tutorial uses create-react-app, a React utility CLI, to quickly scaffold out a simple React app from the terminal. However, if you want to use Angular, Vue, any other framework, or just a folder with a few HTML files, those will all work too.
Tip: If you already have your own application ready to deploy, you can skip ahead to Deploy the Website.
Install the create-react-app npm package
React is a popular framework for building web applications, so we will use it as an example. You can scaffold (create) a new React application using the create-react-app tool. The
create-react-app tool is shipped as an npm module and can be installed by using
npm install -g create-react-app
-g switch installs the
create-react-app globally on your machine so you can run it from anywhere.
Scaffold and build a new application
Next, scaffold a new React app called
my-react-app by running:
Install all of the application's dependencies by switching to the new folder and running
cd my-react-app npm install
And build the application with
npm run build.
npm run build
You should now have a
build folder in your project folder. This contains the
.js files we will be deploying to Azure Storage.
Run the application
Finally, let's ensure that the application runs. From the terminal, start the application using the
npm start command.
Now, open your browser and navigate to http://localhost:3000, where you should see something like this:
You are now ready to deploy your app!