a0a6db8597
Closes #9
32 lines
629 B
Go
32 lines
629 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/librespeed/speedtest/config"
|
|
"github.com/librespeed/speedtest/database"
|
|
"github.com/librespeed/speedtest/results"
|
|
"github.com/librespeed/speedtest/web"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
var (
|
|
optConfig = flag.String("c", "", "config file to be used, defaults to settings.toml in the same directory")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
var conf config.Config
|
|
if *optConfig != "" {
|
|
conf = config.LoadFile(*optConfig)
|
|
} else {
|
|
conf = config.Load()
|
|
}
|
|
|
|
web.SetServerLocation(&conf)
|
|
results.Initialize(&conf)
|
|
database.SetDBInfo(&conf)
|
|
log.Fatal(web.ListenAndServe(&conf))
|
|
}
|