-
-
Save synthetic-intelligence/d9b3fe5419fc149dbc5c84d9258589e2 to your computer and use it in GitHub Desktop.
Revisions
-
drgarcia1986 revised this gist
Jul 5, 2015 . 6 changed files with 16 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- from bottle import route, run 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- # Settings from django.conf import settings @@ -25,7 +24,7 @@ def index(request): return HttpResponse('<h1>Hello Word</h1>') # Routes urlpatterns = ( url(r'^$', index), ) 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- import falcon 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- from flask import Flask 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # -*- coding: utf-8 -*- import muffin app = muffin.Application('hello') @app.register('/') def products(request): return {'hello': 'world'} 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- import tornado.web import tornado.httpserver import tornado.ioloop -
drgarcia1986 revised this gist
Jan 19, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,3 +13,9 @@ def on_get(self, req, resp): app = falcon.API() app.add_route(r'/', Index()) if __name__ == '__main__': from wsgiref import simple_server httpd = simple_server.make_server('127.0.0.1', 8000, app) httpd.serve_forever() -
drgarcia1986 created this gist
Jan 18, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/usr/bin/env python # encoding: utf-8 from bottle import route, run @route('/') def index(): return '<h1>Hello World/h1>' run(host='localhost', port=8000) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ #!/usr/bin/env python # encoding: utf-8 # Settings from django.conf import settings settings.configure( DEBUG=True, SECRET_KEY='secretfoobar', ROOT_URLCONF=__name__, MIDDLEWARE_CLASSES=( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ) # Views from django.http import HttpResponse from django.conf.urls import url def index(request): return HttpResponse('<h1>Hello Word</h1>') urlpatterns = ( url(r'^$', index), ) # RunServer if __name__ == '__main__': from django.core.management import execute_from_command_line import sys execute_from_command_line(sys.argv) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env python # encoding: utf-8 import falcon class Index(): def on_get(self, req, resp): resp.status = falcon.HTTP_200 resp.body = '{"msg": "Hello World"}' app = falcon.API() app.add_route(r'/', Index()) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env python # encoding: utf-8 from flask import Flask app = Flask(__name__) @app.route('/') def index(): return '<h1>Hello World</h1>' app.run() 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/usr/bin/env python # encoding: utf-8 import tornado.web import tornado.httpserver import tornado.ioloop class IndexHandler(tornado.web.RequestHandler): def get(self): self.finish('<h1>Hello World</h1>') if __name__ == '__main__': app = tornado.web.Application([(r'/', IndexHandler)]) http_server = tornado.httpserver.HTTPServer(app) http_server.listen(8000) try: print('Server Start') tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print('Server Stop')