mirror of
https://github.com/usememos/memos.git
synced 2024-12-30 15:03:24 +03:00
32 lines
503 B
Go
32 lines
503 B
Go
package main
|
|
|
|
import (
|
|
"memos/api"
|
|
"memos/store"
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func main() {
|
|
store.InitDBConn()
|
|
|
|
r := mux.NewRouter().StrictSlash(true)
|
|
|
|
api.RegisterAuthRoutes(r)
|
|
api.RegisterUserRoutes(r)
|
|
api.RegisterMemoRoutes(r)
|
|
api.RegisterQueryRoutes(r)
|
|
api.RegisterResourceRoutes(r)
|
|
api.RegisterWebHooksRoutes(r)
|
|
|
|
webServe := api.SPAHandler{
|
|
StaticPath: "./web/dist",
|
|
IndexPath: "index.html",
|
|
}
|
|
|
|
r.PathPrefix("/").Handler(webServe)
|
|
|
|
http.ListenAndServe(":8080", r)
|
|
}
|