mirror of
https://github.com/gomods/athens
synced 2026-02-05 23:00:56 +00:00
* switch proxy to config file pull in single flight changes * changes for single-flight * intermediate stage. All tests passing. pkg still has env refs * remove all env references * delete config/env entirely * fix failing tests * create the config.toml file as part of dev setup * create config file only if it doesn't exist * update Dockerfiles to use config file * move composing elements to the top * verbose parameter naming * newline * add flag for config file path * update docs with config file flag * remove unnecessary nil check * use filepath.join * rename redis port to address * fix path.join * fix issues after merge * add vendor dir
34 lines
586 B
Go
34 lines
586 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
"path/filepath"
|
|
|
|
"github.com/gomods/athens/cmd/proxy/actions"
|
|
"github.com/gomods/athens/pkg/config"
|
|
)
|
|
|
|
var (
|
|
configFile = flag.String("config_file", filepath.Join("..", "..", "config.toml"), "The path to the config file")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
if configFile == nil {
|
|
log.Fatal("Invalid config file path provided")
|
|
}
|
|
conf, err := config.ParseConfigFile(*configFile)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
app, err := actions.App(conf)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
if err := app.Serve(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|