add dockerfile

This commit is contained in:
steven
2021-12-12 11:43:27 +08:00
parent 527745ad15
commit f70ad6891d
4 changed files with 43 additions and 7 deletions

29
server/main.go Normal file
View 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)
}