""" Grass development server ======================== This server is intended for development only: it enables debugging tools, and use a different port (5000) so it can more easily interface with other applications. Launching the server is relatively easy:: $ pyvenv env $ source env/bin/activate; $ python dev.py """ import argparse from tornado.ioloop import IOLoop import tornado.autoreload from grass import api from grass import config from grass import handlers from grass import register_services from grass.logic.jwt_enabled_services import jwtEnabledServices app = api.app app.debug = True if __name__ == '__main__': jwtInstance = jwtEnabledServices.getInstance() jwtInstance.cacheJwtEnabledServices() parser = argparse.ArgumentParser() parser.add_argument( '--port', dest='port', default=8080, help='Optional port to launch the service.') args = parser.parse_args() app.listen(args.port) tornado.autoreload.start() print('Application: http://localhost:{}/'.format(args.port)) IOLoop.current().start()