Ẁith SinPy you can write web applications like this:
class Handler(HttpHandler):
def get(self):
return 'Serving GET /'
def post(self):
return 'Serving POST /'
def put(self):
return 'Serving PUT /'
def delete(self):
return 'Serving DELETE /'
application = Handler()
class Handler(HttpHandler):
a_page = response('Serving GET /a_page')
another_page_html = response('Serving GET /another_page.html')
yet_another = response(get='Serving GET /yet_another',
post='Serving POST /yet_another',
put='Serving PUT /yet_another'
delete='Serving DELETE /yet_another')
class Handler(HttpHandler):
@response
def another_page_html(self):
return 'Serving GET /another_page.html'
@another_page_html.post
def another_page_html(self):
return 'Serving POST /another_page.html'
class Handler(HttpHandler):
# GET /style.css
style_css = static_file('css/style.css')
# GET /static/*.html
static = static_dir('static/*.html')