W01 Learning Activity: Deploy your site
Overview
In this activity, you will deploy your web application to a cloud hosting service so that it can be accessed over the internet.
Activity Instructions
Complete the steps of this activity to create and deploy your site to Render.com, the free cloud hosting service you will use for this course.
Sign up for a Render.com account
Complete the following steps:
- In a web browser, navigate to Render.com.
- Click the Get Started button (likely in the top right corner) to register for a new account.
- For your account type, select GitHub. By using the GitHub login method it will connect your Render.com and GitHub accounts together and make the deployment steps easier later.
- You should see a prompt to authorize Render to access your GitHub identity. Follow the steps in this screen to authorize your GitHub account to be used.
- You should then arrive at the Render.com dashboard.
Create a new Web Service
Complete the following steps:
- Return to Render.com and sign in to arrive at the dashboard page.
- Click the option create a new Web Service (New Web Service ->).
- You should arrive at the Source Code setting with the Git Provider tab selected.
- If no repositories are found, click the GitHub button to configure GitHub to allow Render to access your repositories.
- You may select All repositories so that Render can access any repository you create, or you may select the specific repository you created for this course.
- Click the Install button.
- On the Git Provider tab at Render, select the repository for this course.
- Fill out the form as follows:
- Name: Add a unique name for the service. This is a label that will help you distinguish it from others. It should be simple and descriptive, such as
cse340or perhaps add your initials after it. - Language: select Node.
- Branch: Leave as the default of main.
- Region: Select the region that is nearest to you in the world. This is important because this is where your service will be created.
- Root directory: Leave this empty.
- Build Command: Leave this as
npm install. - Start Command: Change this to
npm start. - Instance type: Select Free.
- Environment Variables: Set a variable named
NODE_ENVwith the valueproduction. - Auto Deploy: Expand the Advanced section to find this setting. Leave this set to On Commit so that future changes to your repository will automatically update your deployed site.
- Click the Deploy Web Service button when you have set all the settings as described.
- Name: Add a unique name for the service. This is a label that will help you distinguish it from others. It should be simple and descriptive, such as
- Wait for the deployment process to complete. This may take several minutes as Render installs dependencies and starts your application.
- Select Events from the Render dashboard to see the progress and any logs related to your deployment.
Verify your deployment
Once the deployment is complete, on the Events tab on the Render dashboard, you should see a green check mark indicating that your service is live and that the latest deployment has succeeded. Complete the following steps:
- From the Render dashboard, click on your newly created web service to open its details page.
- Locate the URL provided for your web service. It should look something like
https://cse340-a6v0.onrender.com. - Click on the URL to open your deployed web application in a new browser tab.
- Verify that your application is functioning as expected. Navigate through the pages and test any interactive features to ensure everything is working correctly.
Optional Video Walkthrough
While the following video may be helpful to see the steps in action, make sure to walk through the written instructions directly because there may be important steps that are not covered in the video.
Direct link: Deploying to Render
Submission
Congratulations! You have now completed all of the learning activities for this week.
To submit this activity, return to Canvas and submit the associated quiz there.
Other Links:
- Return to: Week Overview | Course Home