-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Middleware should enforce trailing / or use <base href> #590
Comments
@mnmtanish could you co-ordinate this? |
I'll check it out |
Hey @ericclemmons Sounds like enforcing a trailing slash will be easy to do! Want to make that PR? I'm also interested in a PR describing how to inject storybook within an express app, as you're doing I believe ? |
This is what I have in our code now: import { Router as router } from "express";
import storybook from "@kadira/storybook/dist/server/middleware";
export default router()
.use(
// Redirect stories to stories/, due to relative URLs
(req, res, next) => {
if (req.originalUrl === "/stories") {
return res.redirect("/stories/");
}
next();
},
storybook(".storybook")
)
; Our app has docs, tools, stories, etc. all available when in development. (We found that no one runs stories if it's a separate process/script. Plus, we need the API access.) |
@ericclemmons Do you think you could write a blogpost & a section in our documentation detailing this and why it's working out so well for you? |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Hi! Given:
Navigating to
/stories
results in a404
ofmanager.bundle.js
because it's loaded at/static/manager.bundle.js
instead of/stories/static/manager.bundle.js
.There are two solutions to this:
<base href="${req.path}/" />
or equivalent in the the HTML.I can submit a PR for either depending on your preference.
The text was updated successfully, but these errors were encountered: