MCPcopy Create free account
hub / github.com/ez4o/github-contribution-graph / Start

Method Start

src/server/server.go:167–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165}
166
167func (s *Server) Start() {
168 s.c = cache.New(30*time.Minute, 1*time.Minute)
169
170 ssrServer := http.NewServeMux()
171 ssrServer.HandleFunc("/", s.handleRender)
172 go http.ListenAndServe(":8687", ssrServer)
173
174 l := launcher.New()
175 l.Set("no-sandbox")
176 headlessBrowserUrl := l.MustLaunch()
177 browser := rod.New().ControlURL(headlessBrowserUrl).MustConnect()
178
179 svgServer := http.NewServeMux()
180 svgServer.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
181 if len(r.URL.String()) > 2 {
182 if r.URL.String()[1] == '?' {
183 s.handleSVG(w, r, browser)
184
185 return
186 }
187 }
188
189 http.NotFound(w, r)
190 })
191 http.ListenAndServe(":8686", svgServer)
192}

Callers 1

mainFunction · 0.95

Calls 1

handleSVGMethod · 0.95

Tested by

no test coverage detected