Re:Building a static serverless website using S3 and CloudFront
by tomcam on Monday February 17, 2020 @06:47PM
(#22352081)
Thanks for sharing that. Nice repo! Can you explain why I wouldn't want an index file in a directory? I assume you mean index.html?
[ Parent
| on HN ]
Re:Building a static serverless website using S3 and CloudFront
by davidweatherall on Tuesday February 18, 2020 @07:54AM
(#22355626)
I do mean index.html! Personally I prefer the url structure of example.com/about as opposed to example.com/about/ - especially when adding on anchors or parameters (example.com/about?param as opposed to /about/?param).
Relative pathing can be useful depending on file structure.
It avoids issues with directory / page naming conflicts. E.g. my images are stored at /assets/img/image.png - but if I wanted to create a page at example.com/assets this would require me to then place an index.html inside my assets directory - which doesn't seem logical.
Overall, mostly personal preference of me disliking the index.html inside directory method - It just doesn't seem like it's the "right" way to access a page. If I have a example.com/about page - I expect them to be hitting an about.html file.