Create virtual environment
virtualenv venv
Activate virtual environment
source venv/bin/activate
Install dependencies
pip install -r requirements.txt
Create an AWS account if you dont have one already and retrieve - public key and private key and then configure aws account on your terminal
aws configure
Refer to zappa_settings.json and change the parameters accoring to your application. You are now ready to deploy the application to staging and production.
zappa deploy <staging/production>
You can now configure your short url domain to route all requests to the URL that is given by zappa in the above step. If you have to update the application, run
zappa update <staging/production>
To delete the deployment run
zappa undeploy <staging/production>
Create a new shortened URL. The webhook paramater here is optional.
curl -XPOST '<short_url_domain>/c' -d '{
"path": "shortpath",
"webhook": "https://f81421ad32aa6b3f557cec14301e1296.m.pipedream.net?id=idtotrack",
"redirect_url": "https://google.com"
}' -H "content-type: application/json"
Retrieve the original URL from the short url
curl '<short_url_domain>/shortpath'
For more information regarding zappa and all the frameworks that it supports, please check out zappa