24 lines
556 B
Go
24 lines
556 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
err := initConfig()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
log.Println("Starting micropub server...")
|
|
log.Println("Current time: " + time.Now().Format(time.RFC3339))
|
|
log.Println("Blog URL: " + BlogUrl)
|
|
log.Println("Ignored URLs for Webmention: " + strings.Join(IgnoredWebmentionUrls, ", "))
|
|
http.HandleFunc("/micropub", HandleMicroPub)
|
|
http.HandleFunc("/media", HandleMedia)
|
|
http.HandleFunc("/webmention", HandleWebmention)
|
|
log.Fatal(http.ListenAndServe(":5555", nil))
|
|
}
|