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: do not rewrite /api and /data-api requests to SvelteKit #162

Merged
merged 9 commits into from
Nov 20, 2023

Conversation

geoffrich
Copy link
Owner

@geoffrich geoffrich commented Nov 20, 2023

Closes #145.

Previously, the '*' rule in the SWA config would catch all POST/PUT/DELETEs and redirect them to the SvelteKit app, even those to external Azure functions. This PR adds "/api/*" and "/data-api/*" routes to the config so that those routes are not rewritten to the SvelteKit app.

I added an external function to the demo app and a E2E test. This makes the "demo" setup slightly more complicated, but I think it's fine.

Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-desert-00b80111e-162.westus2.2.azurestaticapps.net

@geoffrich
Copy link
Owner Author

One of the E2E tests is being flaky. Not sure why, but manually recreating it passes.

@geoffrich geoffrich changed the title Allow POSTing to external Azure functions fix: do not rewrite /api and /data-api requests to SvelteKit Nov 20, 2023
@geoffrich geoffrich marked this pull request as ready for review November 20, 2023 00:38
@geoffrich geoffrich merged commit aa36771 into main Nov 20, 2023
4 of 5 checks passed
@geoffrich geoffrich deleted the issue-145 branch November 20, 2023 00:40
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.

Custom API functions may be caught by the sk_render function
1 participant