mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-01 23:15:27 +08:00
21 lines
229 B
Go
21 lines
229 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
"sync"
|
|
|
|
"ds2api/app"
|
|
)
|
|
|
|
var (
|
|
once sync.Once
|
|
h http.Handler
|
|
)
|
|
|
|
func Handler(w http.ResponseWriter, r *http.Request) {
|
|
once.Do(func() {
|
|
h = app.NewHandler()
|
|
})
|
|
h.ServeHTTP(w, r)
|
|
}
|