HubSpot / facewall

Grid visualization of Gravatars for an organization
http://github.hubspot.com/facewall/
MIT License
138 stars 38 forks source link

Failing to load facewall without ending '/' #9

Closed theold190 closed 9 years ago

theold190 commented 9 years ago

When trying to load facewall without ending '/' (ex. http://localhost:8080/facewall) I get only letter 'f' displayed. Though when I load with ending '/' (ex. http://localhost:8080/facewall/) it works and images are displayed.

It would be great to have same results in both cases.

TrevorBurnham commented 9 years ago

Hmm, I've wondered about this myself. The primary cause is that scripts don't load on that page, because the asset paths in index.html start with

static/

which only works if that path is joined to facewall/. But if you change the asset paths to start with

/facewall/static/`

then even though the scripts load in the browser, you get the error

Cannot find module "initialize"

I'm not sure why this is.

adamschwartz commented 9 years ago

@theold190 thanks for bringing this to our attention.

The router is definitely configured to handle both, so it’s probably not that.

@TrevorBurnham I’m not sure why you’d see that error if indeed the files are being brought in properly. What happens if you remove this line? Do you see any other JS errors? (Obviously the app won’t start up without that, but I’m wondering if that may lead to figuring out the real issue.)

TrevorBurnham commented 9 years ago

Actually, now I'm unable to replicate that JS error. Seems to have been a fluke...

I've submitted a PR that allows the app to run at both /facewall and /facewall/: #12

theold190 commented 9 years ago

This fix worked for me, can use both with and without ending '/'. Thanks!