Skip to content

Instantly share code, notes, and snippets.

@zelark
Created November 13, 2017 15:07
Show Gist options
  • Save zelark/20c8b1299927e41249c4ac265cc31e43 to your computer and use it in GitHub Desktop.
Save zelark/20c8b1299927e41249c4ac265cc31e43 to your computer and use it in GitHub Desktop.
#python #server
from flask import request
from flask import Flask
import json
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route('/test', methods=['PUT'])
def test():
print('log: ' + json.dumps(request.get_json()))
return '', 200
## run it with
## FLASK_APP=server.py flask run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment