piku/examples/python/main.py

14 wiersze
336 B
Python
Czysty Zwykły widok Historia

2016-03-29 19:31:12 +00:00
import os
2016-03-29 20:41:03 +00:00
from bottle import app, get
2016-03-29 19:31:12 +00:00
2016-03-29 20:41:03 +00:00
@get("/")
2016-03-29 19:31:12 +00:00
def default():
table = ['<table border="0">']
for k, v in os.environ.iteritems():
table.append('<tr><th>%s</th><td>%s</td></tr>' % (k, v))
table.append('</table>')
return '\n'.join(table)
2016-03-29 20:41:03 +00:00
if __name__ == '__main__':
run(port=int(os.environ.get("PORT",8080)))