swciitg / IntranetSearch

Apache License 2.0
2 stars 12 forks source link

Setting up MongoDB and creating content model #11

Closed Shifat-Ali closed 1 year ago

Shifat-Ali commented 1 year ago

Changes Made

  1. Added connectDB.js under config which configures mongoDB Atlas with the project
  2. Added contentModel.js under models which creates contentModel as described in issue
  3. Added csvSaveController.js under controllers which provides functionality to export all the documents in contentModel in database to csv file under data folder with header and name given by user
  4. Added scrape.js under routes which add route for above added save to csv functionality

Extra Prerequisites

Extra fields in .env file:

MONGODB_URI = "uri"
DB_NAME = "dbname"

Note:

Shifat-Ali commented 1 year ago

Further Changes Made

  1. Added dummyController.js under controllers in web-crawler to add dummy data for testing save-to-csv feature
  2. Route for adding dummy data [POST] is: "/scrape/add"

Postman Collection For Testing:

Collection

dhaneshragu commented 1 year ago

Hey @Shifat-Ali , LGTM , but there are some changes that you have to make for this PR to be merged.