An example of creating a simple Go application on Heroku that is capable of ingesting routed notes.
- Visit Getting Started on Heroku with Go
- Follow the turorial through in its entirety
- Replace contents of main.go with the main.go code contents found in this repository
- Update dependencies, commit the new code, and deploy your changes to Heroku
$ go mod tidy $ go mod vendor $ git add -A . $ git commit -m "/db" $ git push heroku master
- From the command line, launch the /route GET handler from your Heroku application (This should return an empty page, as the database table storing forwarded route data is still empty)
$ heroku open route - Using Postman (or another similar utility), issue a POST request to the URL opened in the last step, with the following JSON in the Body, configured as (application/json)
{ "Blues Route Test": "Hello from Blues!" }
- Refresh the browser window opened by Step 1 and the following line should be displayed
Read from DB: { "Blues Route Test": "Hello from Blues!" }
- Log in to notehub.io and select "Personal Project"
- Click on "Routes" in the left navigation
- Click "New Route" button in the upper right
- Give the Route a name - "My Route"
- Ensure the "Route Type" dropdown has a selected value of "General HTTP/HTTPS Request/Response"
- Ensure the "Route data from devices" dropdown has a selected value of "All devices"
- Ensure the "Route data from notefiles" dropdown has a selected value of "All notefiles"
- Ensure the "Transform JSON data before routing" dropdown has a selected value of "No transformation"
- Enter the Url from Step 1 of installation verification above into the "Route ro service URL" text box
- Ensure the "Route at a maximum rate" dropdown has a selected value of "Unlimited"
- Ensure the "Enabled" checkbox in upper right is checked
- CLick "Save Route" button in upper right
- Save a notefile to the notecard and sync
- Refresh the browser window opened by Step 1 in the installation verification
- The page should update and display "Read from DB:" with the JSON representing the newly added notefile!