2022-11-13 09:13:32 +00:00
|
|
|
// Package main sets up an simple httpserver without any sites
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
"go.sebtobie.de/generic/logging"
|
|
|
|
"go.sebtobie.de/httpserver/command"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-11-13 09:36:51 +00:00
|
|
|
log.SetOutput(
|
2022-11-13 09:13:32 +00:00
|
|
|
zerolog.MultiLevelWriter(
|
|
|
|
zerolog.ConsoleWriter{
|
|
|
|
Out: os.Stdout,
|
|
|
|
NoColor: false,
|
|
|
|
},
|
|
|
|
logging.NewJournalDWriter(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
s, err := command.Server("config.toml")
|
|
|
|
if s == nil {
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
s.StartServer()
|
|
|
|
}
|