Simple rust web example
This application uses the Timeular Public API, so in order for it to work, you need an account and create developer credentials.
You can either pass these credentials to the application via a me.secret
file in this folder, which needs to look like this:
apiKey
apiSecret
It's also possible to use the API_KEY
and API_SECRET
environment variables.
Start by using cargo run
.
This starts a server on port 8080.
You can then start sending requests to e.g.: GET http://localhost:8080/rest/v1/activities
Available requests:
GET /rest/v1/activities
- returns all activitiesPOST /rest/v1/activities
- creates an activityGET /rest/v1/{activity_id}
- returns an activity with the given idDELETE /rest/v1/{activity_id}
- deletes the activity with the given idPATCH /rest/v1/{activity_id}
- updates the activity with the given id
You can also use docker to build and run this application:
docker build -t analyzer .
docker run -p 8080:8080 -e API_KEY=apiKey -e API_SECRET=apiSecret analyzer