Permalink
Please sign in to comment.
Showing
with
58 additions
and 0 deletions.
- +31 −0 .editorconfig
- +25 −0 app.py
- +2 −0 requirements.txt
| @@ -0,0 +1,31 @@ | ||
| +# top-most EditorConfig file | ||
| +root = true | ||
| + | ||
| +# Unix-style newlines with a newline ending every file | ||
| +[*] | ||
| +end_of_line = lf | ||
| +insert_final_newline = true | ||
| + | ||
| +# Matches multiple files with brace expansion notation | ||
| +# Set default charset | ||
| +[*.{js,py}] | ||
| +charset = utf-8 | ||
| + | ||
| +# 4 space indentation | ||
| +[*.py] | ||
| +indent_style = space | ||
| +indent_size = 4 | ||
| + | ||
| +# Tab indentation (no size specified) | ||
| +[Makefile] | ||
| +indent_style = tab | ||
| + | ||
| +# Indentation override for all JS under lib directory | ||
| +[lib/**.js] | ||
| +indent_style = space | ||
| +indent_size = 2 | ||
| + | ||
| +# Matches the exact files either package.json or .travis.yml | ||
| +[{package.json,.travis.yml}] | ||
| +indent_style = space | ||
| +indent_size = 2 |
| @@ -0,0 +1,25 @@ | ||
| +from flask import Flask, request, Response | ||
| +app = Flask(__name__) | ||
| + | ||
| + | ||
| +@app.route('/overflow', methods=['post']) | ||
| +def overflow(): | ||
| + ''' | ||
| + Example: | ||
| + /overflow hello world | ||
| + ''' | ||
| + user_id = request.values.get('user_id') | ||
| + user_name = request.values.get('user_name') | ||
| + channel_name = request.values.get('channel_name') | ||
| + text = request.values.get('text') | ||
| + | ||
| + return Response(text, content_type='text/plain; charset=utf-8') | ||
| + | ||
| + | ||
| +@app.route('/') | ||
| +def hello(): | ||
| + return 'Hello World!' | ||
| + | ||
| + | ||
| +if __name__ == '__main__': | ||
| + app.run(debug=True) |
| @@ -0,0 +1,2 @@ | ||
| +flask==0.10.1 | ||
| +py-stackexchange==2.2.004 |
0 comments on commit
4dd1813