speedtest-go/main.go

26 lines
541 B
Go
Raw Normal View History

package main
import (
2020-06-16 04:10:58 -04:00
"flag"
2020-08-19 22:32:50 -04:00
log "github.com/sirupsen/logrus"
"github.com/librespeed/speedtest/config"
"github.com/librespeed/speedtest/database"
"github.com/librespeed/speedtest/results"
"github.com/librespeed/speedtest/web"
)
2020-06-16 04:10:58 -04:00
var (
optConfig = flag.String("c", "", "config file to be used, defaults to settings.toml in the same directory")
)
func main() {
2020-06-16 04:10:58 -04:00
flag.Parse()
2020-11-10 03:33:19 -05:00
conf := config.Load(*optConfig)
2020-06-16 04:10:58 -04:00
web.SetServerLocation(&conf)
results.Initialize(&conf)
database.SetDBInfo(&conf)
log.Fatal(web.ListenAndServe(&conf))
}