nutools/lib/ulib/templates/webpyapp/server.py

25 lines
606 B
Python

# -*- coding: utf-8 mode: python -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
__all__ = ('Server',)
try: True, False
except: True, False = 1, 0
from ulib.web import web, Application, Page, defaults
class Server(Application):
PORT = 3000
def __init__(self, basedir=None, templatedir=None, host=None, port=None, debug=None):
Application.__init__(self, basedir, templatedir, host, port, debug)
class index(Page):
PREFIX = r'/'
if __name__ == '__main__':
import sys
from os import path
basedir = path.abspath(path.split(__file__)[0])
Server(basedir).run(sys.argv[1:])