memos/server/main.go
STEVEN aa40793a68
Add resources api (#9)
* feat: add resource api

* update delete model return variables
2021-12-14 20:08:12 +08:00

31 lines
472 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)
webServe := api.SPAHandler{
StaticPath: "./web/dist",
IndexPath: "index.html",
}
r.PathPrefix("/").Handler(webServe)
http.ListenAndServe(":8080", r)
}