mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
add dockerfile
This commit is contained in:
29
server/main.go
Normal file
29
server/main.go
Normal file
@ -0,0 +1,29 @@
|
||||
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)
|
||||
|
||||
spa := api.SPAHandler{
|
||||
StaticPath: "./web/dist",
|
||||
IndexPath: "index.html",
|
||||
}
|
||||
|
||||
r.PathPrefix("/").Handler(spa)
|
||||
|
||||
http.ListenAndServe(":8080", r)
|
||||
}
|
Reference in New Issue
Block a user