MCPcopy Index your code
hub / github.com/apache/devlake / RunApiServer

Function RunApiServer

backend/server/api/api.go:162–179  ·  view source on GitHub ↗
(router *gin.Engine)

Source from the content-addressed store, hash-verified

160}
161
162func RunApiServer(router *gin.Engine) {
163 // Get port from config
164 port := basicRes.GetConfig("PORT")
165 // Trim any : from the start
166 port = strings.TrimLeft(port, ":")
167 // Convert to int
168 portNum, err := strconv.Atoi(port)
169 if err != nil {
170 // Panic if PORT is not an int
171 panic(fmt.Errorf("PORT [%s] must be int: %s", port, err.Error()))
172 }
173
174 // Start the server
175 err = router.Run(fmt.Sprintf(":%d", portNum))
176 if err != nil {
177 panic(err)
178 }
179}
180
181func registerExtraOpenApiSpecs(router *gin.Engine) {
182 for name, pluginMeta := range plugin.AllPlugins() {

Callers 1

CreateAndRunApiServerFunction · 0.85

Calls 3

RunMethod · 0.80
GetConfigMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected