2019-11-07 10:00:24 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
"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)
|
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))
|
|
|
|
}
|