mirror of
https://github.com/usememos/memos.git
synced 2024-12-19 09:02:49 +03:00
aa40793a68
* feat: add resource api * update delete model return variables
31 lines
472 B
Go
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)
|
|
}
|