Backend - SMEISEN/RidingCoachApp GitHub Wiki

API

email endpoint

Navigate to /backend/tests

Open the terminal in this folder

Use the .raw file
backend/tests/4cbf23f48cb0edfa.raw

to create a POST request
curl -H 'host: 659edb8e.proxy.webhookapp.com' -H 'connection: close' -H 'user-agent: CloudMailin Server' -H 'content-type: multipart/form-data; boundary=----cloudmailinboundry' -H 'accept-encoding: gzip, compressed' -H 'x-request-id: 8a01c859-cfdb-4188-9883-8a33ead2a2ad' -H 'x-forwarded-for: 52.64.201.55' -H 'x-forwarded-proto: https' -H 'x-forwarded-port: 443' -H 'via: 1.1 vegur' -H 'connect-time: 0' -H 'x-request-start: 1610891804516' -H 'total-route-time: 0' -H 'content-length: 16053' --data-binary @4cbf23f48cb0edfa.raw --request POST http://localhost:5000/api/email

New test-files can be created with the Webhook App

  1. Open heoku dashboard
  2. Click on cloudmailin add-on
  3. Click on "Debug in WebhookApp"
  4. Login
  5. Send an email with a lap-list to the cloudmailing-address
  6. The request will show up under "recent requests"
  7. Click on details of the latest request
  8. Click on actions-> Show curl
  9. Follow the instructions
    • download new .raw file to /backend/tests
    • copy the curl command
    • replace https:// by http://
    • replace address by localhost:5000

Database

Migrations

Heroku Dashboard -> Select App -> More -> Run console

Upgrade to latest migration
flask db upgrade --directory=/app/backend/migrations/

Upgrade to specific migration
flask db upgrade --directory=/app/backend/migrations/ <revision>
e.g. <revision> = f332352598ee

⚠️ **GitHub.com Fallback** ⚠️