Created
November 13, 2017 15:07
-
-
Save zelark/20c8b1299927e41249c4ac265cc31e43 to your computer and use it in GitHub Desktop.
#python #server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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