Open druv5319 opened 4 years ago
I think nedb would be well suited for this. I need to figure out where you're using the database in the current code though.
It’s used only within the getProducts function and getProductPrices function within the controller file where the Sneaks class is located.
I am also using a mongoose schema for the Sneaker object so I’m not sure if nedb will be compatible with it.
Yeah, I see/saw. I might use this as a guide to see what we can do with it: https://www.sderosiaux.com/articles/2015/02/09/creating-an-api-with-nodejs-expressjs-nedb-and-mongodb/#save-the-data-inside-a-database-nedb
Maybe the camo library could help transition it over from mongoDB to nedb? Allows use of a schema.
I'm dying here bc mongoDB is acting up for me lol...get some strange errors running it on my Mac
Having a database within this API makes it so searched sneakers including their links to each of the resell sites are cached. Because of this, when searching for product prices, the API is instantly able to grab prices with the product links already cached from previous searches. Currently, this API is dependant on MongoDB and requires users to install MongoDB and have its process running. I'm looking for a way so users don't have to install and run MongoDB, any contributions are greatly appreciated, thanks!