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

Fix: Support .html requests in dev #3401

Merged
merged 4 commits into from
May 18, 2022
Merged

Conversation

tony-sull
Copy link
Contributor

Changes

This updates the dev server to support .html requests, currently only /blog is matched and /blog.html would 404

Testing

Added a test to verify .html is supported in dev when config.build.format === 'file'

Docs

None, bug fix only

@changeset-bot
Copy link

changeset-bot bot commented May 18, 2022

🦋 Changeset detected

Latest commit: 3258e26

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 18, 2022
@tony-sull tony-sull force-pushed the fix/dev-routing-file-format branch from 80b4f6b to ed0fcce Compare May 18, 2022 18:46
@tony-sull tony-sull marked this pull request as ready for review May 18, 2022 18:47
expect(response.status).to.equal(200);
});

it('200 when loading /', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 glad to see this test, we should still support not including index.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have also named this PR "Fun with Regexes" 😄

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tony-sull tony-sull merged commit 0d3c673 into main May 18, 2022
@tony-sull tony-sull deleted the fix/dev-routing-file-format branch May 18, 2022 20:09
@github-actions github-actions bot mentioned this pull request May 18, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* WIP: this regex should handle .html as well

* much simpler!  Just fix the req.url, don't touch the manifest

* only handle .html requests when config.build.format === 'file'

* chore: add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants