Skip to content

Commit

Permalink
an api to get launcher version
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Oct 6, 2023
1 parent b6ca9eb commit 53de1b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/transports/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func Build() fx.Option {
web.Write(w, map[string]string{"version": version.Version}) //nolint:errcheck
})

router.Get("/launcher", func(w http.ResponseWriter, r *http.Request) {
web.Write(w, map[string]string{"version": cfg.LauncherVersion, "download": "https://github.com/openmultiplayer/launcher/releases"}) //nolint:errcheck
})

router.HandleFunc(
"/{rest:[a-zA-Z0-9=\\-\\/]+}",
func(w http.ResponseWriter, r *http.Request) {
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Config struct {
ServerScrapeInterval time.Duration `envconfig:"SERVER_SCRAPE_INTERVAL" required:"false" default:"30m"`
PackageSearchInterval time.Duration `envconfig:"PACKAGE_SEARCH_INTERVAL" required:"false" default:"24h"`
PackageScrapeInterval time.Duration `envconfig:"PACKAGE_SCRAPE_INTERVAL" required:"false" default:"24h"`
LauncherVersion string `envconfig:"LAUNCHER_VERSION" required:"false" default:"1"`
}

func New() (c Config, err error) {
Expand Down

0 comments on commit 53de1b9

Please sign in to comment.