aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/main.go
blob: 748e4bb5c533e0826b67f94f21c468527493d86d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"

	"paterissa.net/mblog/cmd/web/handlers"
)

func main() {
	webmaster := flag.String("webmaster", "", "host of the website")
	port := flag.Int("port", 5050, "the hosting port")
	flag.Parse()

	router := handlers.RegisterEndpoints(*webmaster)
	log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), router))
}