1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

33 lines
479 B
Go
Raw Normal View History

2017-05-16 13:39:59 +02:00
package main
2017-05-16 15:22:40 +02:00
import (
"log"
"net/http"
2017-05-16 17:24:08 +02:00
"github.com/julienschmidt/httprouter"
2017-05-16 15:22:40 +02:00
)
2017-05-16 13:39:59 +02:00
func main() {
printBanner()
2017-05-16 15:22:40 +02:00
// Load configuration
2017-05-16 16:00:01 +02:00
log.Println("Using configuration: ...")
2017-05-16 15:22:40 +02:00
2017-05-16 17:24:08 +02:00
// Setup request routing
router := httprouter.New()
2017-05-16 16:00:01 +02:00
// Serve static content
2017-05-16 17:24:08 +02:00
err := httpRegisterAssets(router)
if err != nil {
log.Fatal(err)
}
2017-05-16 15:22:40 +02:00
2017-05-18 14:44:50 +02:00
err = apiRegisterEndpints(router)
if err != nil {
log.Fatal(err)
}
2017-05-16 15:22:40 +02:00
// Start http server
2017-05-16 17:24:08 +02:00
log.Fatal(http.ListenAndServe(":7340", router))
2017-05-16 13:39:59 +02:00
}