mirror of
https://github.com/rjNemo/go-wiki
synced 2026-06-06 02:36:40 +00:00
24 lines
423 B
Go
24 lines
423 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/rjNemo/go-wiki/controllers"
|
|
"github.com/rjNemo/go-wiki/data"
|
|
"github.com/rjNemo/go-wiki/settings"
|
|
)
|
|
|
|
func main() {
|
|
data.UsePSQL()
|
|
startServer(settings.Port, controllers.Router)
|
|
}
|
|
|
|
func startServer(p string, r func()) {
|
|
log.Printf("Start Go-wiki server on http://localhost:%s", p)
|
|
port := ":" + p
|
|
r()
|
|
log.Fatal(http.ListenAndServe(port, nil))
|
|
}
|
|
|
|
// appBuilder
|