Files
athens/cmd/proxy/main.go
Rohan Chakravarthy 0e470d0294 Plumb config - Latest (#627)
* 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
2018-09-11 15:04:20 -07:00

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)
}
}