Hop makes it easy to deploy any Node.js application. This guide focusses on the deployment of an Express application, however it applies to any Node.js web application.

Demo

We have created a demo application that you can deploy to Hop to see how it works. It’s a simple Express application that exposes a single endpoint that returns the hostname of the container it’s running on.

Deploying the demo

  1. Fork node-express-app on GitHub.
  2. Create a new Hop deployment on the Console and select the GitHub repository you just forked.
  3. Hit Deploy and wait for the build to finish.
  4. To expose your application to the web, create a Gateway and point it to port 3000.

That’s it! You’re now able to scale your Express application horizontally and take advantage of all the features Hop has to offer.

Adding a health check (optional)

Health checks are a great way to ensure your application has zero downtime. Health checks insure that:

  • If your application is not responding to requests, Hop will automatically restart it, and
  • when containers start, the health check must succeed before the container gets added to your Gateway (load balancer)

To add a health check, first visit the Health Check page in your new deployment. Then, add a new health check with the following settings:

SettingValue
Path/
Port3000

Once entered, click Create Check. Your health check is now active and will be queried to ensure zero downtime. You can see health check success status update in realtime on the Hop console.