Manager
The Manager is the API that handles CRUD operations for Velocity. The API is written in Go with the Echo framework.
Last updated
The Manager is the API that handles CRUD operations for Velocity. The API is written in Go with the Echo framework.
Last updated
You can deploy the manager on any platform that supports running Go applications. We will be making use of fly.io in our case.
Head over to https://fly.io and create a new account if you don't have one already. Next, download the flyctl
CLI by following the instructions on their website for your operating system. Now, run the following command to authenticate the CLI with your credentials.
The actual deployment is as simple as running flyctl deploy
. This will build your application and start a fly machine running the Manager API.
The Manager API uses Postgres to store data and as such you need to configure the API to connect to your database. The API expects DSN string set as an environment variable as so
Make sure you replace the values for user
, password
, host
and database
with appropriate values depending on your setup
In addition to the DSN string set above, there are a few more environment variables you need to set.
S3_UPLOAD_BUCKET: This is the name of the S3 bucket where the function code gets deployed.
AWS_ACCESS_KEY_ID: AWS access key allowing us to upload the function code to the S3 bucket
AWS_SECRET_ACCESS_KEY: AWS secret access key allowing us to upload the function code to the S3 bucket
AWS_REGION: The AWS region of the S3 bucket where the function code gets deployed.
WORKER_URL: This is the URL of the Windhoek API. If the Windhoek API is deployed on a single server, make sure you specify the <ip_address>:<port>