Flight calculator

This is a simple micro-service to calculate flights. This service is built with Encore.dev - see more about it (generated interactive API docs, how to run it, etc.) in the sections below.

Demo API

Demo API docs and Admin dashboard are available at Encore staging environment (requires Admin/Member access) to preview and experiment with.

Endpoints however are publicly available:

curl 'https://staging-flight-router-c9fi.encr.app/calculate' -d '{"flights":[["IND","EWR"],["SFO","ATL"],["GSO","IND"],["ATL","GSO"]]}'

Running locally

encore run --port=8080

Open the developer dashboard

While encore run is running, open http://localhost:9400/ to access Encore's local developer dashboard.

Here you can see API docs, make requests in the API explorer, and view traces of the responses.

Using the API

To see that your app is running, you can try this Curl command:

curl 'http://127.0.0.1:8080/calculate' -d '{"flights":[["IND","EWR"],["SFO","ATL"],["GSO","IND"],["ATL","GSO"]]}'

Deployment

Deploy your application to a staging environment in Encore's free development cloud:

git add -A .
git commit -m 'Commit message'
git push encore

Then head over to the Cloud Dashboard to monitor your deployment and find your production URL.

From there you can also connect your own AWS or GCP account to use for deployment.

Testing

encore test ./...