32 Zeilen
500 B
Go
32 Zeilen
500 B
Go
// 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() {
|
|
log.SetOutput(
|
|
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()
|
|
}
|