Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't serve index.html as a site index #100

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

jeef3
Copy link
Contributor

@jeef3 jeef3 commented Apr 12, 2016

This switch prevents the static files from serving index.html as an index. This means you can still have a index.html file in your static path and it won't get served up as the application index. Fixes #99.

From the ExpressJS documentation: http://expressjs.com/en/api.html#express.static

Sends the specified directory index file. Set to false to disable directory indexing.

However, if the browser is navigated to (for example) http://localhost:9001/index.html then it will serve the index.html from the static path. This does not conflict with the application though as there is no application index.html file to serve anyway.


Another fix was to move the:

app.get('/', function (req, res) {
  res.send(getIndexHtml());
});

above the if (program.staticDir) { ... } call, but I believe this PR solves the problem more correctly.

This switch prevents the static files from serving `index.html` as an
index. Fixes storybookjs#99.
@arunoda
Copy link
Member

arunoda commented Apr 12, 2016

I have not aware of this switch. And I think this is the best way to deal with this.
Thanks a lot.
We will take this in.

@thani-sh thani-sh merged commit 0ff689d into storybookjs:master Apr 12, 2016
@jeef3 jeef3 deleted the static-files-index branch April 13, 2016 10:01
@tdreyno
Copy link

tdreyno commented Jun 7, 2016

This doesn't seem to apply to the static storybook build. When I run that, the storybook index.html is overwritten by the index.html in my static directory.

@jeef3
Copy link
Contributor Author

jeef3 commented Jun 8, 2016

@tdreyno I believe this PR was done before the static build stuff was completed. Probably best to raise as a new issue 👍

@shilman shilman added the misc label May 27, 2017
Copy link

nx-cloud bot commented Apr 12, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 776cfa1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants