2 """Call this to start the application."""
3 from sys import exit as sys_exit
4 from plomtask.misc import HandledException
5 from plomtask.http import TaskHandler, TaskServer
8 TEMPLATES_DIR = 'templates'
11 if __name__ == '__main__':
13 server = TaskServer(TEMPLATES_DIR,
14 ('localhost', HTTP_PORT), TaskHandler)
15 print(f'running at port {HTTP_PORT}')
17 server.serve_forever()
18 except KeyboardInterrupt:
19 print('aborting due to keyboard interrupt')
21 except HandledException as e:
22 print(f'Aborting due to: {e}')