Deploy a node-schedule
application on Koyeb
Learn more about Koyeb
·
Explore the documentation
·
Discover our tutorials
Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management.
This repository contains is designed to show how a node-schedule
application can be deployed to Koyeb. The demo application aggregates the top ten most-commented on Hacker news posts and sends them to a designated email address using a cron-like schedule.
You can follow the associated tutorial to learn more about the application and how it works.
Follow the steps below to deploy and run the Nuxt application on your Koyeb account.
You need a Koyeb account to successfully deploy and run this application. If you don't already have an account, you can sign-up for free.
You also need a Mailgun account to send the email with the aggregated links. From your Mailgun account, you need to configure an authorized recipient email address and then retrieve the following details associated with your account:
API_KEY
: The Mailgun private API key associated for your account.DOMAIN
: The sandbox domain for your account.EMAIL
: Thepostmaster@
email address associated with your Mailgun domain.RECIPIENT_EMAIL
: The authorized email address that you configured to receive email.
The fastest way to deploy the Nuxt application is to click the Deploy to Koyeb button below.
Clicking on this button brings you to the Koyeb App creation page with most of the settings pre-configured to launch this application. You will need to replace the values for the following variables:
Environment variable | Required? | Description |
---|---|---|
API_KEY |
yes | Mailgun account private API key |
DOMAIN |
yes | Mailgun account sandbox domain |
EMAIL |
yes | Mailgun domain's postmaster@ email address |
RECIPIENT_EMAIL |
yes | The Mailgun authorized recipient email address |
SCHEDULE |
no | An optional node-schedule cron schedule (default: every 2 minutes) |
To modify this application example, you will need to fork this repository. Checkout the fork and deploy instructions.
If you want to customize and enhance this application, you need to fork this repository.
If you used the Deploy to Koyeb button, you can simply link your service to your forked repository to be able to push changes. Alternatively, you can manually create the application as described below.
On the Koyeb Control Panel, on the Overview tab, click the Create Web Service button to begin.
- Select GitHub as the deployment method.
- Choose the repository containing your application code.
- In the Environment variables section, click the Add variable button to fill in the environment variables outlined above.
- Choose a name for your App and Service, for example
example-node-schedule
, and click Deploy.
Your node-schedule
application will be deployed to Koyeb. You can follow the build process as the repository is cloned, built, and deployed. Once the deployment is complete, it will aggregate Hacker News post data and send it to the configured email address according to the schedule provided.
If you have any questions, ideas or suggestions regarding this application sample, feel free to open an issue or fork this repository and open a pull request.