File tree Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,7 @@ This is a backend for grading C++ code in a secure and controlled manner.
11
11
12
12
## API
13
13
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 ] ( )
31
15
32
16
## Author
33
17
Original file line number Diff line number Diff line change 9
9
"github.com/markhuang1212/code-grader/backend/internal/util"
10
10
)
11
11
12
+ const ApiPrefix = "/api/v1"
13
+
12
14
type GradeResultResponse struct {
13
15
Ready bool
14
16
Result types.GradeResult
@@ -26,7 +28,7 @@ func SetupRouter(cc *core.CoreController) *gin.Engine {
26
28
c .Redirect (http .StatusTemporaryRedirect , "https://app.swaggerhub.com/apis-docs/markhuang1212/CodeGraderCore" )
27
29
})
28
30
29
- authorized := r .Group ("/api/v1" )
31
+ authorized := r .Group (ApiPrefix )
30
32
31
33
authorized .POST ("/grade" , func (c * gin.Context ) {
32
34
You can’t perform that action at this time.
0 commit comments