pjam76 / mobius-marcus-aurelius

An example app for MOBI (Mobius) using Python in Google App Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog Post

Install

# pip2 install --upgrade pip setuptools # to upgrade pip
pip2 install -t lib -r requirements.txt

cp config.py.example to config.py
vi config.py

Test

dev_appserver.py .
  • Test without charging
    • Note: This will not charge and will use the API call 'balance' instead of 'use'
curl "localhost:8080?email=test@testing.com&test_key=YOUR_TEST_KEY"
  • Example output
{"quote": "Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth.", "num_credits": "4.0", "charged_credits": "0.0"}
  • Test with an actual charge
curl "localhost:8080?email=test@testing.com"
  • Example output
{"quote": "Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth.", "num_credits": "4.0", "charged_credits": "0.001"}

Deploy

gcloud app deploy app.yaml

Mobius Testing

curl -G "https://mobius.network/api/v1/app_store/balance" \
     -H "x-api-key: API_KEY_HERE" \
     -d "app_uid=APP_UID" \
     -d "email=EMAIL"

Notes

About

An example app for MOBI (Mobius) using Python in Google App Engine

License:MIT License


Languages

Language:Python 100.0%