Skip to content

Commit 7931e7b

Browse files
authored
Merge pull request #1 from Tushar3099/interviewBranch
added link routes
2 parents ed150ad + e09af38 commit 7931e7b

File tree

21 files changed

+675
-23
lines changed

21 files changed

+675
-23
lines changed

client/.eslintcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"D:\\Webdev\\remote-code-executor\\client\\src\\components\\home\\Header.js":"1","D:\\Webdev\\remote-code-executor\\client\\src\\reducers\\actions\\index.js":"2","D:\\Webdev\\remote-code-executor\\client\\src\\components\\home\\Modal.js":"3"},{"size":2726,"mtime":1610883574576,"results":"4","hashOfConfig":"5"},{"size":408,"mtime":1610835459540,"results":"6","hashOfConfig":"5"},{"size":1661,"mtime":1610883492826,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"j0ormm",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\Webdev\\remote-code-executor\\client\\src\\components\\home\\Header.js",["14","15"],"D:\\Webdev\\remote-code-executor\\client\\src\\reducers\\actions\\index.js",[],"D:\\Webdev\\remote-code-executor\\client\\src\\components\\home\\Modal.js",["16","17"],{"ruleId":"18","severity":1,"message":"19","line":51,"column":20,"nodeType":"20","messageId":"21","endLine":51,"endColumn":22},{"ruleId":"22","severity":1,"message":"23","line":75,"column":15,"nodeType":"24","endLine":79,"endColumn":17},{"ruleId":"25","severity":1,"message":"26","line":23,"column":6,"nodeType":"27","endLine":23,"endColumn":11,"suggestions":"28"},{"ruleId":"22","severity":1,"message":"23","line":32,"column":7,"nodeType":"24","endLine":36,"endColumn":9},"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'unclick'. Either include it or remove the dependency array. If 'unclick' changes too often, find the parent component that defines it and wrap that definition in useCallback.","ArrayExpression",["29"],{"desc":"30","fix":"31"},"Update the dependencies array to be: [ref, unclick]",{"range":"32","text":"33"},[727,732],"[ref, unclick]"]
1+
[{"/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/home/Home.js":"1"},{"size":1283,"mtime":1610541864648,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kizngo","/media/shweta/New Volume/projects/RCE-aasf/remote-code-executor/client/src/components/home/Home.js",[]]

client/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const code =
2-
'#include<iostream.h>\nusing namespace std;\nint main()\n{\n\t//Code\n\tcout<<"Hello World";\n\treturn 0;\n}';
2+
'#include<iostream>\nusing namespace std;\nint main()\n{\n\t//Code\n\tcout<<"Hello World";\n\treturn 0;\n}';
33

44
export default code;

rce-server/package-lock.json

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rce-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"dotenv": "^8.2.0",
2121
"express": "^4.17.1",
2222
"jsonwebtoken": "^8.5.1",
23+
"mongoose": "^5.11.12",
2324
"pino": "^6.7.0",
2425
"socket.io": "^3.0.5",
2526
"swagger-express-middleware": "^4.0.2",

rce-server/server/api/controllers/Interview/controller.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
import Server from "../../../common/server";
1+
import InterviewService from "../../services/interview.service";
2+
const BASE_URI = process.env.BASE_URI;
23

34
export class Controller {
45
async connect(req, res) {
5-
const uid = req.params.uid;
6-
console.log(uid);
6+
try {
7+
if (!req.user) {
8+
throw {
9+
message: "User must be logged in!!",
10+
};
11+
} else {
12+
const uid = req.params.uid;
13+
const link = `${BASE_URI}/interview/${uid}`;
14+
console.log(uid);
15+
output = await InterviewService.execute(link, user);
16+
if (output) {
17+
res.json({
18+
status: 200,
19+
message: "Connected to interview",
20+
output,
21+
});
22+
}
23+
}
24+
} catch (error) {
25+
res.send({
26+
status: error.status || "500",
27+
message: error.message || "Something Went Wrong",
28+
});
29+
}
730
}
831
}
932

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as express from "express";
22
import controller from "./controller";
3+
import isLoggedIn from "../../middlewares/isLogged.handler";
34

4-
export default express.Router().post("/:uid", controller.connect);
5+
export default express.Router().get("/:uid", isLoggedIn, controller.connect);

0 commit comments

Comments
 (0)