mirror of
https://github.com/rjNemo/go-wiki
synced 2026-06-06 02:36:40 +00:00
20 lines
356 B
Go
20 lines
356 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/rjNemo/go-wiki/controller"
|
|
"github.com/rjNemo/go-wiki/settings"
|
|
)
|
|
|
|
func main() {
|
|
startServer(settings.Port, controller.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))
|
|
}
|