Browse Source

Add server template

pull/10/head
Hironsan 6 years ago
parent
commit
97e426e1c0
3 changed files with 34 additions and 0 deletions
  1. 34
      doccano/server/run_server.py
  2. 0
      doccano/server/static/.gitkeep
  3. 0
      doccano/server/templates/index.html

34
doccano/server/run_server.py

@ -0,0 +1,34 @@
import os
import tornado.ioloop
import tornado.web
import tornado.httpserver
from tornado.web import url
class IndexHandler(tornado.web.RequestHandler):
def get(self):
self.render('index.html')
def post(self):
pass
BASE_DIR = os.path.dirname(__file__)
def main():
application = tornado.web.Application([
url(r'/', IndexHandler, name='index'),
],
template_path=os.path.join(BASE_DIR, 'templates'),
static_path=os.path.join(BASE_DIR, 'static'),
)
http_server = tornado.httpserver.HTTPServer(application)
port = int(os.environ.get('PORT', 8080))
http_server.listen(port)
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
main()

0
doccano/server/static/.gitkeep

0
doccano/server/templates/index.html

Loading…
Cancel
Save