Skip to content

stevebrownlee/python-kennels

Repository files navigation

Simple Python JSON Server

watchgod request_handler.main

Deploying to Heroku

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages