karanjthakkar / showmyprs.com

See all your Open Source contributions in one place
https://showmyprs.com
MIT License
30 stars 4 forks source link

Same username but different case breaks cache implementation #9

Open karanjthakkar opened 7 years ago

karanjthakkar commented 7 years ago

Currently when the username karanjthakkar is searched, the cache file of it is created with the name karanjthakkar. However, if the username that is searched becomes KARAnjtHAkkar, then there will be cache miss because it will search for KARAnjtHAkkar.

argonlaser commented 7 years ago

Hi @karanjthakkar . Thanks for the wonderful project. I have the fix ready. While testing it, when I ran the locally compiled binary and used the localhost:8080 to query the github API, instead of creating the local cache in my machine, I think its using the cache in the hosted server machine. The router.GET "user/:username" is not getting hit locally with my changes. Need help in testing my change locally.

karanjthakkar commented 7 years ago

Hey @argonlaser, thanks for taking the time to look into this. Can you explain the steps you did to setup the project and run the local server? If I know what you're doing, I can help you better :)

argonlaser commented 7 years ago

Repro steps

1) Edited the code and built the code. 2) I ran the showmyprs.com created locally and used the link localhost:8080 in the browser. 3) The home page is seen and I entered my github username in the textbox. 4) When I clicked the button, I was expecting to route to some page like localhost:8080/user/<username> but instead it got routed to showmyprs.com/user/username . 5) Some debug prints that I added in router.GET "user/:username" function is not getting exercised.

Did I miss something?

karanjthakkar commented 7 years ago

@argonlaser Are you starting up the server using go build && ./showmyprs.com as mentioned in the Contributing section in the README?

argonlaser commented 7 years ago

Hi @karanjthakkar , this line redirects the \user\:username to the hosted webpage. I had changed that line to redirect to my local route like this localhost:8080. I think it would be better to keep that as a configurable variable so that for debug we could config our local route.

karanjthakkar commented 7 years ago

@argonlaser For now, yes, ideally that should be configurable. For now, what you can do is directly access the url http://localhost:8080/user/<username> once you startup the server.