(router *gin.Engine)
| 160 | } |
| 161 | |
| 162 | func 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 | |
| 181 | func registerExtraOpenApiSpecs(router *gin.Engine) { |
| 182 | for name, pluginMeta := range plugin.AllPlugins() { |
no test coverage detected