Created
October 10, 2013 15:20
-
-
Save kvalle/6920172 to your computer and use it in GitHub Desktop.
Enkel server for Extreme Startup med Flask i Python
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
import re | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/', endpoint='index') | |
def index(): | |
question = request.args.get("q", "").partition(": ")[2] | |
answer = "the answer" | |
print "\nQ: %s?\nA: %s" % (question, answer) | |
return answer | |
if __name__ == "__main__": | |
app.run(debug=True, port=1337, host="10.0.50.102") # bytt ut med din IP her |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment