Stock price tracker - code review


I’m looking for a code review on stock price tracker project which you can find here:



Thanks in advance :slight_smile: Really appreciate your help.


Is it possible to see price over time?

I did not get your question …

Give me clear example want to you want

Exactly how do you track the price?

You can do it in Google quite easily

I am using this third party api for stock price “"+stock+"/quote”;

I just want someone to review my code !

I am using this third party api for stock price “"+stock+"/quote”;

I’m not sure what the challenge is asking for but what you have so far seems to be a basic API tester.
It does not have a user friendly interface or any graphs/charts showing history over time.
If you want your code reviewed it is combined with what seems to be free code camp boilerplate code so what do you want us to review? :face_with_raised_eyebrow:

Thanks for your reply. Here is the challenge link If you could review controller/stockHandler.js and routes/server.js pages than I will be grateful. Thanks

As this is just testing an api, you can test if it works or not.
Your code looks fine to me. :slight_smile:

I look on git and I found on forumsthat await and async is out of date use New Promise callback

second you have unnecesary code of likes without likes. it will be hard to maintain.
obj.likes = 1; with this you cannot have likes more than one.

Thanks :slight_smile:

Thanks :slight_smile: actually in the challenge it says you can not have likes more than one. 1 is the maximum value you can store.

not have likes more than one per one IP.

that was the requirement for this challenge .

PER ONE IP, but summary there could be unlimited likes. plural likes.

Oh… I interpreted it wrong !! Thanks for you clarification.

You mix var and let in a lot of your code. I would go through and update to just using one. Most of your variables could be const though because they are not getting redefined.

I would clean up your routes file.
Expect from chai is being imported and I don’t see it being used.
I would instantiate StockHandler controller outside of your export function as well as move the findAndUpdate function out of it as well.
You use Array.isArray(stock) multiple times so I would just store that result in a variable.

I would give more descripted function/variable names. Some people (myself included) does not know what stockHandler.stockObj does and won’t want to go search your controller to find out.