mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
431 B
Go
30 lines
431 B
Go
4 years ago
|
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)
|
||
4 years ago
|
api.RegisterUserRoutes(r)
|
||
4 years ago
|
api.RegisterMemoRoutes(r)
|
||
|
api.RegisterQueryRoutes(r)
|
||
|
|
||
|
spa := api.SPAHandler{
|
||
|
StaticPath: "./web/dist",
|
||
|
IndexPath: "index.html",
|
||
|
}
|
||
|
|
||
|
r.PathPrefix("/").Handler(spa)
|
||
4 years ago
|
|
||
4 years ago
|
http.ListenAndServe(":8080", r)
|
||
4 years ago
|
}
|