Created
January 4, 2016 06:49
-
-
Save goodwillcoding/acab29e74c264ce178c4 to your computer and use it in GitHub Desktop.
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 characters
from wsgiref.simple_server import make_server | |
from pyramid.config import Configurator | |
from pyramid.response import Response | |
from rest_toolkit import resource | |
@resource('/') | |
class Greeting(object): | |
def __init__(self, request): | |
pass | |
@Greeting.GET() | |
def show_root(root, request): | |
return {'message': 'Hello, world'} | |
if __name__ == '__main__': | |
config = Configurator() | |
config.include('rest_toolkit') | |
config.scan() | |
app = config.make_wsgi_app() | |
server = make_server('0.0.0.0', 8080, app) | |
server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment