This repository is a demo of how one can use the Point In Time Scheduler with a REST application.
To deploy this demo app, you need an AWS account, have yarn
or npm
installed on your machine, and have
an AWS profile that the serverless framework
can assume to deploy the application.
You will also need to sign in at the Point In Time Scheduler Dashboard.
- Run
yarn
ornpm install
to install the required dependencies - Run
yarn deploy
ornpm run deploy
to deploy the demo app to your AWS account - When the deployment finishes you will see an API key and a URL for the receiveMessage endpoint. You will need those later.
Sign in at the Point In Time Scheduler Dashboard and register your first application.
In the first step choose the integration type REST. Then click on next.
In the next step enter the URL of the endpoint for receiving messages. You can find it on the terminal where you deployed the application.
If you forgot to keep it, you can run yarn deploy
again to have it printed again.
In the following step you specify the authentication. The demo app is configured to create an API key that is visible on the terminal after deployment.
The demo app requires this api key to be passed with the header x-api-key
, so change the header name as shown below. Then
enter the api key as the header value.
Give your app a name and description, something like "Demo App" is enough to later remember what this was for. The description is optional.
In the last step generate an API key. The demo app will need this to call the scheduler. Copy the application id and api key.
You can provide the id and key via environment variables. Assuming you have the App ID "123" and API key "S3crEt", run
APP_ID=123 API_KEY=S3crEt yarn deploy
. You may have to put ""
around your API key.
Wait for the deployment to complete, then open your AWS Console and navigate to CloudWatch Metrics.
After a few minutes, a new namespace called "SchedulerDemo" will appear. You should see more messages being sent than received initially. The demo schedules them for a random point in time over the next 30 minutes.
You can modify the number of messages per minute with the environment variable MESSAGES_PER_MINUTE
. Example: MESSAGES_PER_MINUTE=10 APP_ID=123 API_KEY=S3crEt yarn deploy
Please use the GitHub issues of this repo to provide feedback, or use this form.