watchgod request_handler.main
- Create an account on Heroku, It's free.
- At the dashboard, click the New button and select "Create a new app". Give the app whatever name you like.
- Install Heroku CLI
- Login to Heroku with
heroku login
. - Add
Procfile
to project with the following content.web: python request_handler.py $PORT
- Change end of request handler to the following code.
def main(): host = '' port = int(os.environ['PORT']) HTTPServer((host, port), HandleRequests).serve_forever() main()
- Remove
.db
from your.gitignore
file. heroku git:remote -a kennel-server
git push heroku main
and wait for the deploy to complete.- Activate dyno with
heroku ps:scale web=1
and wait for confirmation that it started. - Open Postman and perform a GET to your deployed app's URL and a resource and you should get a response.