Skip to content

Instantly share code, notes, and snippets.

@MiyamonY
Created May 27, 2015 02:44
Show Gist options
  • Save MiyamonY/36715d7e7c942eaaee0c to your computer and use it in GitHub Desktop.
Save MiyamonY/36715d7e7c942eaaee0c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from flask import Flask, make_response
from flask.ext.script import Manager
app = Flask(__name__)
manager = Manager(app)
@app.route('/string/')
def return_string():
return 'Hello World!'
# @app.route('/object/')
# def return_object():
# headers = {'Content-Type': 'text/plain'}
# return make_response('Hello, World!', status=200, headers=headers)
@app.route('/tuple/')
def return_tuple():
return 'Hello, World!', 200, {'Content-Type':'text/plain'}
if __name__ == '__main__':
manager.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment