wfc-server/sake/main.go
Palapeli c002bb81a6
Some checks are pending
Build CI / build (push) Waiting to run
golangci-lint / lint (push) Waiting to run
Rework HTTP request handling entirely
2026-04-06 11:35:02 -04:00

33 lines
669 B
Go

package sake
import (
"net/http"
"wwfc/common"
"wwfc/database"
)
var (
db database.Connection
)
func StartServer(reload bool) {
// Get config
config := common.GetConfig()
common.ReadGameList()
// Start SQL
db = database.Start(config)
}
func Shutdown() {
db.Close()
}
func RegisterHandlers(mux *http.ServeMux) {
mux.HandleFunc("POST /SakeStorageServer/StorageServer.asmx", handleStorageRequest)
mux.HandleFunc("GET /SakeFileServer/download.aspx", handleFileDownloadRequest)
mux.HandleFunc("POST /SakeFileServer/upload.aspx", handleFileUploadRequest)
mux.HandleFunc("GET /SakeFileServer/ghostdownload.aspx", handleMarioKartWiiGhostDownloadRequest)
}