diff --git a/config.json b/config.json new file mode 100644 index 0000000..9a6a717 --- /dev/null +++ b/config.json @@ -0,0 +1,5 @@ +{ + "development": { + "port": 8888 + } +} \ No newline at end of file diff --git a/handlers/sequence.py b/handlers/sequence.py new file mode 100644 index 0000000..a2c72af --- /dev/null +++ b/handlers/sequence.py @@ -0,0 +1,15 @@ +class SequenceHandler(RequestHandler): + def post(self, dir_name_array): + # response + try: + # get the image paths + # cut them into sequences + # move them to path /sequence// + # do the sequence generating + self.set_status(200) + + except: + self.write_error() + + finally: + self.finish() diff --git a/index.py b/index.py new file mode 100644 index 0000000..3485184 --- /dev/null +++ b/index.py @@ -0,0 +1,16 @@ +import tornado.ioloop +import tornado.web +import json +from os import environ +# config +with open('config.json', 'w') as f: + config = json.load(f) + +devPort = config[environ['ENV'] if 'ENV' in environ.keys() else 'development'] + +if __name__ == "__main__": + app = tornado.web.Application([ + url(r'/sequence', sequenceHandler) + ]) + app.listen(devPort) + app.ioloop.IOLoop.current().start() \ No newline at end of file