Skip to content

Commit

Permalink
- rename from app to api
Browse files Browse the repository at this point in the history
  • Loading branch information
spolnik committed Oct 2, 2018
1 parent 36bbffd commit a14a03e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/app.go → api/api.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app
package api

import (
"bytes"
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package main
import (
"flag"
"github.com/gin-gonic/gin"
"github.com/jalgoarena/skeleton-code-java/app"
"github.com/jalgoarena/skeleton-code-java/api"
"log"
"net/http"
)

func SetupRouter() *gin.Engine {
router := gin.Default()

router.GET("health", app.HealthCheck)
router.GET("health", api.HealthCheck)
v1 := router.Group("api/v1")
{
v1.GET("/code/java/:problemId", app.GetSkeletonCode)
v1.GET("/code/java/:problemId", api.GetSkeletonCode)
}

return router
Expand All @@ -34,7 +34,7 @@ func init() {
}

func main() {
app.SetupProblems(problemsUrl, &http.Client{})
api.SetupProblems(problemsUrl, &http.Client{})
router := SetupRouter()
router.Run(":" + port)
}
10 changes: 5 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"bytes"
"github.com/jalgoarena/skeleton-code-java/app"
"github.com/jalgoarena/skeleton-code-java/api"
"github.com/stretchr/testify/assert"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -40,7 +40,7 @@ public class Solution {
)

httpClient := &MockHttpClient{problemJson: problemsJson}
app.SetupProblems(problemsUrl, httpClient)
api.SetupProblems(problemsUrl, httpClient)

router := SetupRouter()

Expand Down Expand Up @@ -70,7 +70,7 @@ public class Solution {
)

httpClient := &MockHttpClient{problemJson: problemsJson}
app.SetupProblems(problemsUrl, httpClient)
api.SetupProblems(problemsUrl, httpClient)

router := SetupRouter()

Expand Down Expand Up @@ -101,7 +101,7 @@ public class Solution {
)

httpClient := &MockHttpClient{problemJson: problemsJson}
app.SetupProblems(problemsUrl, httpClient)
api.SetupProblems(problemsUrl, httpClient)

router := SetupRouter()

Expand Down Expand Up @@ -131,7 +131,7 @@ public class Solution {
)

httpClient := &MockHttpClient{problemJson: problemsJson}
app.SetupProblems(problemsUrl, httpClient)
api.SetupProblems(problemsUrl, httpClient)

router := SetupRouter()

Expand Down

0 comments on commit a14a03e

Please sign in to comment.