OLD | NEW |
1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """This modules is imported by AppEngine and defines the 'app' object. | 5 """This modules is imported by AppEngine and defines the 'app' object. |
6 | 6 |
7 It is a separate file so that application bootstrapping code like ereporter2, | 7 It is a separate file so that application bootstrapping code like ereporter2, |
8 that shouldn't be done in unit tests, can be done safely. This file must be | 8 that shouldn't be done in unit tests, can be done safely. This file must be |
9 tested via a smoke test. | 9 tested via a smoke test. |
10 """ | 10 """ |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 def is_enabled_callback(): | 32 def is_enabled_callback(): |
33 return config.settings().enable_ts_monitoring | 33 return config.settings().enable_ts_monitoring |
34 | 34 |
35 # App that serves HTML pages and old API. | 35 # App that serves HTML pages and old API. |
36 frontend_app = handlers_frontend.create_application(False) | 36 frontend_app = handlers_frontend.create_application(False) |
37 gae_ts_mon.initialize(frontend_app, is_enabled_fn=is_enabled_callback) | 37 gae_ts_mon.initialize(frontend_app, is_enabled_fn=is_enabled_callback) |
38 # Local import, because it instantiates the mapreduce app. | 38 # Local import, because it instantiates the mapreduce app. |
39 from mapreduce import main | 39 from mapreduce import main |
40 gae_ts_mon.initialize(main.APP, is_enabled_fn=is_enabled_callback) | 40 gae_ts_mon.initialize(main.APP, is_enabled_fn=is_enabled_callback) |
41 # App that serves new endpoints API. | 41 api = endpoints.api_server([ |
42 api = endpoints.api_server([handlers_endpoints.swarming_api]) | 42 handlers_endpoints.swarming_api, |
| 43 # components.config endpoints for validation and configuring of luci-config |
| 44 # service URL. |
| 45 config.ConfigApi, |
| 46 ]) |
43 ts_mon_metrics.initialize() | 47 ts_mon_metrics.initialize() |
44 return frontend_app, api, main.APP | 48 return frontend_app, api, main.APP |
45 | 49 |
46 | 50 |
47 app, endpoints_app, mapreduce_app = create_application() | 51 app, endpoints_app, mapreduce_app = create_application() |
OLD | NEW |