Read the below instructions the deploy the application on heroku:
-
Download and install the gcp config file named imagefilterapi-config.json with in the root directory.
-
Setup config in heroku env varibles. Run below commands.
heroku config:set GCP_CREDENTIALS="$(< ./imagefilterapi-config.json)" --app image-filtering-for-browser heroku config:set GOOGLE_APPLICATION_CREDENTIALS=api_keys_from_google_vision_api.json --app image-filtering-for-browser
-
Build the go code
GOOS=linux GOARCH=amd64 go build -o ./build/image-filtering-for-browser
-
Deploy the code on heroku for master branch
-
To check the logs
heroku logs --tail --app image-filtering-for-browser
Sample Curl:
curl -X POST https://image-filtering-for-browser-daf2c3a53445.herokuapp.com/verify_image \
-H "Content-Type: application/json" \
-d '{"image_url": "https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0"}'