Question service leverages BeautifulSoup as a HTML Parser/Web Scraper, used on this webpage. The HTML parsed is then stored as a string in our database, using html-react-parser to convert the HTML string to DOM elements.
On top of that, it provides an additional comment/discussion section, which is meant to act as a discussion space for users to discuss potential solutions or give insights.
Run cd question-service from the root of the project.
Run npm install to install dependencies
- After installing dependencies, run
npm run devto start the application. - The service should be started on http://localhost:8002.
Run npm run test to execute tests.
GET request to http://localhost:8002/api/question/question.
GET request to http://localhost:8002/api/question/question/:title
Example:
Title: Two Sum
Endpoint: http://localhost:8002/api/question/question/two-sum
POST request to http://localhost:8002/api/question/question
Example request body:
{
title: 'Title',
description: 'Description',
difficulty: 'Easy'
}POST request to http://localhost:8002/api/question/question/:title
Example:
Title: Two Sum
Endpoint: http://localhost:8002/api/question/question/two-sum
Request body:
{
user: 'User',
comment: 'Comment'
}