mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
43 lines
669 B
ReStructuredText
43 lines
669 B
ReStructuredText
Deploying Responder
|
|
===================
|
|
|
|
You can deploy Responder anywhere you can deploy a basic Python application.
|
|
|
|
Heroku Deployment
|
|
-----------------
|
|
|
|
The basics::
|
|
|
|
$ mkdir myapp
|
|
$ cd myapp
|
|
$ git init
|
|
$ heroku create
|
|
...
|
|
|
|
Install Responder::
|
|
|
|
$ pipenv install responder
|
|
...
|
|
|
|
Write out a `api.py`::
|
|
|
|
import responder
|
|
|
|
api = responder.API()
|
|
|
|
@api.route("/")
|
|
async def hello(req, resp):
|
|
resp.text = "hello, world!"
|
|
|
|
api.run()
|
|
|
|
Write out a ``Procfile``::
|
|
|
|
web: python api.py
|
|
|
|
That's it! Next, we commit and push to Heroku::
|
|
|
|
$ git add -A
|
|
$ git commit -m 'initial commit'
|
|
$ git push heroku master
|