Created
August 8, 2019 05:33
-
-
Save peterjpxie/a94106ac10a94b1905adaef7b0a717b7 to your computer and use it in GitHub Desktop.
This file contains 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 Flask | |
import time | |
app = Flask(__name__) | |
@app.route('/json', methods=['POST', 'GET']) | |
def test_json(): | |
time.sleep(0.2) # simulate delay | |
return '{"code": 1, "message": "Hello, World!" }' | |
# Run in HTTP | |
app.run(host='127.0.0.1', port='5000') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment