- clone the repo
npm install
docker-compose up
npm run start
- Load all questions between 01-03-22 and 31-03-22 having the tags
nodejs, mongo and express
curl --location --request POST 'localhost:3000/load?from=1646092800&to=1648684800&tags=nodejs;mongo;express'
- Load all questions between 01-04-22 and 07-04-22
curl --location --request POST 'localhost:3000/load?from=1648771200&to=1649289600'
- Get stats
curl --location --request GET 'localhost:3000/stats?k=50'
Following are some of the improvements which can be made, but were not implemented due to lack of time.
- Use ts instead of js for static type safety
- Organize the project in a proper file structure
- Validate all API endpoints
- Error handling for
got.get()
,sql.query()
etc - Remove redundant insertion queries, filter data before bulk insert