Chromium Code Reviews| 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 under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Main entry point for Swarming service. | 5 """Main entry point for Swarming service. |
| 6 | 6 |
| 7 This file contains the URL handlers for all the Swarming service URLs, | 7 This file contains the URL handlers for all the Swarming service URLs, |
| 8 implemented using the webapp2 framework. | 8 implemented using the webapp2 framework. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 | 226 |
| 227 This landing page is stamped with the OAuth 2.0 client id from the | 227 This landing page is stamped with the OAuth 2.0 client id from the |
| 228 configuration.""" | 228 configuration.""" |
| 229 @auth.public | 229 @auth.public |
| 230 def get(self, page): | 230 def get(self, page): |
| 231 if not page: | 231 if not page: |
| 232 page = 'swarming' | 232 page = 'swarming' |
| 233 | 233 |
| 234 params = { | 234 params = { |
| 235 'client_id': config.settings().ui_client_id, | 235 'client_id': config.settings().ui_client_id, |
| 236 #'client_id': 525190223929-uban7ac2410omu2a9e65jvpe8b4rkmue.apps.googleuse rcontent.com, | |
|
Ryan Tseng
2017/06/05 22:25:48
Remove this entirely.
Sergey Berezin (google)
2017/06/05 22:43:02
Remove this from the final code.
For local dev_ap
ayanaadylova
2017/06/06 01:25:01
Done.
ayanaadylova
2017/06/06 01:25:01
Done.
| |
| 236 } | 237 } |
| 237 # Can cache for 1 week, because the only thing that would change in this | 238 # Can cache for 1 week, because the only thing that would change in this |
| 238 # template is the oauth client id, which changes very infrequently. | 239 # template is the oauth client id, which changes very infrequently. |
| 239 self.response.cache_control.no_cache = None | 240 self.response.cache_control.no_cache = None |
| 240 self.response.cache_control.public = True | 241 self.response.cache_control.public = True |
| 241 self.response.cache_control.max_age = 604800 | 242 self.response.cache_control.max_age = 604800 |
| 242 try: | 243 try: |
| 243 self.response.write(template.render( | 244 self.response.write(template.render( |
| 244 'swarming/public_%s_index.html' % page, params)) | 245 'swarming/public_%s_index.html' % page, params)) |
| 245 except template.TemplateNotFound: | 246 except template.TemplateNotFound: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 ] | 306 ] |
| 306 return [webapp2.Route(*i) for i in routes] | 307 return [webapp2.Route(*i) for i in routes] |
| 307 | 308 |
| 308 | 309 |
| 309 def create_application(debug): | 310 def create_application(debug): |
| 310 routes = [] | 311 routes = [] |
| 311 routes.extend(get_routes()) | 312 routes.extend(get_routes()) |
| 312 routes.extend(handlers_bot.get_routes()) | 313 routes.extend(handlers_bot.get_routes()) |
| 313 routes.extend(handlers_endpoints.get_routes()) | 314 routes.extend(handlers_endpoints.get_routes()) |
| 314 return webapp2.WSGIApplication(routes, debug=debug) | 315 return webapp2.WSGIApplication(routes, debug=debug) |
| OLD | NEW |