-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/prabhat/frontend' into yitong/d5…
…-frontend
- Loading branch information
Showing
18 changed files
with
574 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ COPY . . | |
|
||
RUN npx prisma migrate dev --name init | ||
|
||
EXPOSE 3004 | ||
EXPOSE 3004 9000 | ||
|
||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,5 @@ yarn.lock | |
*.swp | ||
*~ | ||
dev.db | ||
dev.db-journal | ||
migrations/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
interface Question { | ||
questionId: Number; | ||
title: string; | ||
description: string; | ||
categories: string[]; | ||
complexity: "Easy" | "Medium" | "Hard"; | ||
link: string; | ||
testCases: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
} | ||
export default Question; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import axios from "axios"; | ||
import { configDotenv } from "dotenv"; | ||
import Question from "./model/question"; | ||
|
||
configDotenv(); | ||
const fetchRandomQuestion = async (complexity: string, categories: string) => { | ||
const fetchRandomQuestion = async ( | ||
complexity: string, | ||
categories: string | ||
): Promise<Question | null> => { | ||
const response = await axios.post(`${process.env.QUESTION_SERVICE}/random`, { | ||
complexity, | ||
categories, | ||
}); | ||
return response.data; | ||
if (response.status !== 200) { | ||
return null; | ||
} else { | ||
return response.data; | ||
} | ||
}; | ||
|
||
export { fetchRandomQuestion }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.