You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-35Lines changed: 54 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CodeX API
2
2
3
-
> This API is still in very early stages of development. So consider not using the API in production.
3
+
> This API is still in very early stages of development. So consider not using the API in production since things might change in the future.
4
4
5
5
### Introducing the new CodeX API
6
6
@@ -38,20 +38,20 @@ More coming very soon!
38
38
### NodeJS Example to Execute API Call?
39
39
40
40
```js
41
-
var axios =require("axios");
42
-
var qs =require("qs");
41
+
var axios =require('axios');
42
+
var qs =require('qs');
43
43
var data =qs.stringify({
44
-
code:"import java.util.Scanner;\npublic class MatSym {\n public static void main(String[]args) {\n Scanner in = new Scanner(System.in);\nSystem.out.println(in.nextLine());\nSystem.out.println(in.nextLine());\n }\n}",
45
-
language:"java",
46
-
input:"Hello\nWorld",
44
+
'code':'val = int(input("Enter your value: ")) + 5\nprint(val)',
@@ -69,11 +69,12 @@ The output is a JSON object comprising only one parameter that is the output.
69
69
70
70
```json
71
71
{
72
-
"success": true,
73
-
"timestamp": "2022-05-26T19:59:08.014Z",
74
-
"output": "Hello\nWorld\n",
75
-
"language": "java",
76
-
"version": "11.0.15"
72
+
"timeStamp": 1672439982964,
73
+
"status": 200,
74
+
"output": "Enter your value: 12\n",
75
+
"error": "",
76
+
"language": "py",
77
+
"info": "Python 3.6.9\n"
77
78
}
78
79
```
79
80
@@ -84,24 +85,42 @@ The output is a JSON object comprising only one parameter that is the output.
84
85
This endpoint allows you to list all languages supported and their versions.
85
86
86
87
```json
87
-
[
88
-
{
89
-
"language": "java",
90
-
"compilerVersion": "11.0.15"
91
-
},
92
-
{
93
-
"language": "cpp",
94
-
"compilerVersion": "11.2.0"
95
-
},
96
-
{
97
-
"language": "py",
98
-
"compilerVersion": "3.7.7"
99
-
},
100
-
{
101
-
"language": "c",
102
-
"compilerVersion": "11.2.0"
103
-
}
104
-
]
88
+
{
89
+
"timeStamp": 1672440064864,
90
+
"status": 200,
91
+
"supportedLanguages": [
92
+
{
93
+
"language": "java",
94
+
"info": "openjdk 11.0.17 2022-10-18\nOpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu218.04)\nOpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu218.04, mixed mode, sharing)\n"
95
+
},
96
+
{
97
+
"language": "cpp",
98
+
"info": "g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0\nCopyright (C) 2017 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
99
+
},
100
+
{
101
+
"language": "py",
102
+
"info": "Python 3.6.9\n"
103
+
},
104
+
{
105
+
"language": "c",
106
+
"info": "gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0\nCopyright (C) 2017 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
107
+
},
108
+
{
109
+
"language": "js",
110
+
"info": "v16.13.2\n"
111
+
},
112
+
{
113
+
"language": "go",
114
+
"info": "go version go1.10.4 linux/amd64\n"
115
+
},
116
+
{
117
+
"language": "cs",
118
+
"info": "Mono C# compiler version 4.6.2.0\n"
119
+
}
120
+
]
121
+
}
105
122
```
106
123
124
+
> This API is deployed on a free instance on [render](https://render.com/) so shoutout to render for providing a platform that helped bringing back the CodeX API after a long down time. Since I am using a free tier, the API might be slow sometimes, so please be patient while I try to fund this project.
0 commit comments