URL Shortener Microservice - feedback wanted

Hi all,

I’ve been trying to complete the FCC program, and I’m so close. I just passed the URL shortener microservice challenge - but I’m having some issues with inconsistent performance.

Basically - it only works sometimes. I can’t really seem to tell why. It seems like maybe it hasn’t fully written the shortened URL to the database or something, because if i wait a few minutes to go to the shortened url it will correctly redirect the browser.

This apparently will pass FCC tests, but I am not really satisfied with the quality of this work.

Any feedback would be much appreciated.

code available at https://glitch.com/edit/#!/fcc-url-shortener-microservice-paalwilliams

1 Like

I think the db.close() methods will close the db connection until the server is restarted.

Ah- duh! Yeah this was it. Works swimmingly now. Thanks so much!!

@paalpwmd

Your project is running fast as expected. But, I noticed, when I use only a word as url it also records and return the result with shorturl that is not expected as per the project requirement. Hope, you got the point

Ah, yes you are correct! I’ll go ahead and add that in :slight_smile:

EDIT: Added the feature using regex and seems to be working well :slight_smile: