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

Add --fallback-url option to dev server #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caseyWebb
Copy link

@caseyWebb caseyWebb commented May 5, 2024

Hey! 👋🏼

This PR adds a --fallback-url=<http://127.0.0.1:3000> option to elm-pages dev.

For my use-case, this allows proxying to an existing legacy app for unresolved requests (and handling 404s there), rather than hitting the legacy app first and proxying to the dev server.

For some context, I'm using an adapter like this for the build/prod version

express()
  .use(express.static(elmPagesDistDir))
  .use('/app', elmPagesSSR)
  .use(createProxyMiddleware({ target: 'http://127.0.0.1:3000' }))

where all of my elm-pages routes are behind /app (and there are not any /app routes in the fallback app, OK to use elm-pages 404 page–may make sense to expand this to cover that use case though and forgo elm-pages 404 handling entirely?)

Happy to make any changes!

Copy link

netlify bot commented May 5, 2024

👷 Deploy request for elm-pages-todos pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9ce65ea

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.

1 participant