Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyaoi committed Dec 5, 2018
1 parent b02588b commit 1afeb76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cli/daemon.go
Expand Up @@ -31,12 +31,13 @@ type RunRepoRequest struct {
}

// Handle Post Request -> Run a Repo
func PostRepoHandler(c *gin.Context) {
func PostRunningRepoHandler(c *gin.Context) {
var runRepoRequest RunRepoRequest
c.BindJSON(&runRepoRequest)
go runRepo(runRepoRequest.Vendor, runRepoRequest.Name, runRepoRequest.Solver, runRepoRequest.Port)
c.JSON(http.StatusOK, gin.H{
"code": "success",
"port": runRepoRequest.Port,
})
}

Expand Down Expand Up @@ -117,7 +118,7 @@ func runServer(port string) {
})
})
r.GET("/repo/meta/:vendor/:name", GetRepoMetaHandler)
r.POST("/repo", PostRepoHandler)
r.POST("/repo/running", PostRunningRepoHandler)
r.GET("/repos", GetReposHandler)
r.GET("/socket.io/", socketHandler)
r.POST("/socket.io/", socketHandler)
Expand Down
2 changes: 1 addition & 1 deletion cli/handler.go
Expand Up @@ -112,7 +112,7 @@ func RepoHandler(c *cli.Context) {
"solver": runParams[2],
"port": runningPort,
}
ClientPost("repo", requestParams)
ClientPost("repo/running", requestParams)
case "ps":
requestParams := map[string]string{}
ClientGet("repos", requestParams)
Expand Down

0 comments on commit 1afeb76

Please sign in to comment.