| #!/usr/bin/env python |
| # Copyright 2017 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| """Runs a local development server.""" |
| |
| import os |
| import subprocess |
| |
| |
| def LocalServer(): |
| """Starts a local development server with autoreload.""" |
| cmd = tuple( |
| 'gunicorn --workers 1 -b :8080 main:app --reload'.split()) |
| env = dict( |
| os.environ, |
| CIDB_CRED_DIR='creds/cidb.dbg', |
| DEBUG='True', |
| IS_SERVICE='False') |
| subprocess.call(cmd, env=env) |
| |
| |
| if __name__ == '__main__': |
| LocalServer() |