How to host a Node/Express.js for free with Cyclic.sh

ยท

2 min read

Hosting your Node/Express.js application is an important part of being a developer, and being able to share your work with others gives this sense of satisfaction. Follow these simple steps to see how it feels.

To host a Node/Express.js API on Cyclic, you need the following:

  • A Node/Express.js Application and

  • A GitHub Repository for the API

Step 1: Push The Code To GitHub

Here is a step-by-step guide to pushing your local code to a GitHub repo here

Step 2: Sign Up for Cyclic.sh

Visit Cyclic.sh and sign up for a free account or sign in using your GitHub, to make deploying easier. Once you've signed up, you'll be taken to your dashboard.

This is what your dashboard should look like. Click the "deploy now" button to continue to the next step.

Step 3: Select The Repository

Select the "link your own" option and click the "Search your repositories" input button. This shows the list of the repositories you have on your GitHub account. Select the repository you wish to host

Click "connect" on the subsequent pop-up, and your project is deployed ๐ŸŽ‰๐ŸŽ‰. However, if you have a .env file, then you need to take extra steps to set it up.

Step 4: Add Environment Variables

If your app requires .env variables, click on the "environment variables console" button which shows up after you have deployed your project, and add any environment variables that your app requires.

Cyclic automatically detects your .env variables. Click "Save" to save your .env variables, and your app will be automatically redeployed to reflect your changes.

Step 5: Enjoy Your Free Hosting

That's it ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰! Your Express.js application is now hosted for free on Cyclic.sh. You can access it by clicking on the "Overview" tab in your dashboard and clicking the app URL.

Conclusion

I hope you have been able to learn how to host your free Node/Express App by following this step-by-step guide. If you have more questions, do leave them in the comment sections.