Skip to content

Commit 93bda9d

Browse files
add docs
1 parent aeaf47c commit 93bda9d

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

README.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,7 @@ This is a backend for grading C++ code in a secure and controlled manner.
1111

1212
## API
1313

14-
### Grade Code Request
15-
16-
```bash
17-
curl --location --request POST 'http://localhost:8080/api/v1/grade' \
18-
--header 'Content-Type: application/json' \
19-
--data-raw '{
20-
"TestCaseName": "example-1",
21-
"UserCode": "int main() { cout << \"Hello\"; }"
22-
}'
23-
```
24-
25-
### Retrieve Grade Result
26-
27-
```bash
28-
curl --location \
29-
--request GET 'http://localhost:8080/api/v1/result/cbaf98c458f3878df6f5'
30-
```
14+
[https://app.swaggerhub.com/apis-docs/markhuang1212/CodeGraderCore]()
3115

3216
## Author
3317

backend/internal/api/setup_router.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"github.com/markhuang1212/code-grader/backend/internal/util"
1010
)
1111

12+
const ApiPrefix = "/api/v1"
13+
1214
type GradeResultResponse struct {
1315
Ready bool
1416
Result types.GradeResult
@@ -26,7 +28,7 @@ func SetupRouter(cc *core.CoreController) *gin.Engine {
2628
c.Redirect(http.StatusTemporaryRedirect, "https://app.swaggerhub.com/apis-docs/markhuang1212/CodeGraderCore")
2729
})
2830

29-
authorized := r.Group("/api/v1")
31+
authorized := r.Group(ApiPrefix)
3032

3133
authorized.POST("/grade", func(c *gin.Context) {
3234

0 commit comments

Comments
 (0)