Vheissu / the-aurelia-2-book

Code examples and extra learning exercises for The Aurelia 2 Book.
3 stars 2 forks source link

Catstore server does not return specific product #18

Closed atSridharIyer closed 3 years ago

atSridharIyer commented 3 years ago

So http://localhost:3002/products returns the following json:

[{"id":1,"title":"Nostradamus","description":"Own this quality cat photo, inspired by the gods themselves. Carefully curated and precisely engineered to elicit feelings of happiness and sheer satisfaction.","price":120},{"id":2,"title":"Cute Cat","description":"This sure is a purrty cat, don't you think? Make your friends and foes envious with your new fine feline purchase. A picture is worth a thousand words and this picture is worth one million of them (just not in price).","price":684}]

but

http://localhost:3002/product/1 http://localhost:3002/product/2

does not return anything.

Not sure what the reason might be. No compilation or runtime errors. Delving deeper into the code I think I see the promise resolving without throwing any error but the row returned is undefined.

Number of errors in the book also.

I encourage you to at least get the code compiling and running and the server issue resolved to make the book more useful.

Cheers and thanks for all your opensource efforts.

atSridharIyer commented 3 years ago

There was an error in db.ts in db.get which caused this problem. I have created a pull request for the fix. #19 #

atSridharIyer commented 3 years ago

Fixed in pull request.