hugo-micropub/main.go

24 lines
556 B
Go
Raw Normal View History

2019-11-07 10:00:24 +00:00
package main
import (
"log"
"net/http"
2019-12-06 09:32:30 +00:00
"strings"
2019-11-07 10:00:24 +00:00
"time"
)
func main() {
2020-01-01 12:44:44 +00:00
err := initConfig()
if err != nil {
log.Fatal(err)
}
2019-11-07 10:00:24 +00:00
log.Println("Starting micropub server...")
log.Println("Current time: " + time.Now().Format(time.RFC3339))
2019-12-06 09:32:30 +00:00
log.Println("Blog URL: " + BlogUrl)
log.Println("Ignored URLs for Webmention: " + strings.Join(IgnoredWebmentionUrls, ", "))
2019-12-12 15:29:26 +00:00
http.HandleFunc("/micropub", HandleMicroPub)
2020-01-01 12:44:44 +00:00
http.HandleFunc("/media", HandleMedia)
2019-12-12 15:29:26 +00:00
http.HandleFunc("/webmention", HandleWebmention)
2019-11-07 10:00:24 +00:00
log.Fatal(http.ListenAndServe(":5555", nil))
}