| // Copyright 2020 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Frontend service handles home page, API and redirects. Static files are |
| // served by GAE directly (configured in app.yaml). |
| package main |
| |
| import ( |
| "fmt" |
| |
| "go.chromium.org/luci/config/server/cfgmodule" |
| "go.chromium.org/luci/server" |
| "go.chromium.org/luci/server/cron" |
| "go.chromium.org/luci/server/gaeemulation" |
| "go.chromium.org/luci/server/module" |
| |
| "go.chromium.org/infra/appengine/cr-rev/config" |
| ) |
| |
| func main() { |
| modules := []module.Module{ |
| cron.NewModuleFromFlags(), |
| cfgmodule.NewModuleFromFlags(), |
| gaeemulation.NewModuleFromFlags(), |
| } |
| |
| server.Main(nil, modules, func(srv *server.Server) error { |
| cfg, err := config.Get(srv.Context) |
| if err != nil { |
| return fmt.Errorf("failed to load configuration file: %w", err) |
| } |
| |
| if err := setupImport(srv.Context, cfg); err != nil { |
| return fmt.Errorf("failed to setup import: %w", err) |
| } |
| |
| cron.RegisterHandler("import-config", config.Set) |
| return nil |
| }) |
| } |