abaga129 / sveltekit-adapter-iis

15 stars 5 forks source link

Making external routes optional #4

Closed Palkess closed 10 months ago

Palkess commented 10 months ago

Excellent work with this repo, fits the needs I was looking for perfectly when trying to deploy a SvelteKit app with IIS!

However, the external route rewrite rule was a bit of a bump to get over when setting up the site. It kept giving me a 403.14 - Forbidden error until I noticed the rewrite rule named "block".

In my project I don't have a need for external routes so when I didn't provide any external routes, the rewrite rule matches against ^()/* which matches everything. I solved it by providing a "dummy"-route to the externalRoutes option in the svelte.config.js config but it would be neat to not have to do that and just have it disabled by default if no routes are provided.

KraXen72 commented 10 months ago

Good point! i'd move the block rule to a const in the same function, rather than inlining it like you did, since i think that would look better. but good work.

Palkess commented 10 months ago

@KraXen72 I moved it into a const now instead and I agree it looks better! It still looks a bit messy since the const should match the indent of the rest of the output below, would be nice if there was an easier way to do that.

abaga129 commented 10 months ago

@Palkess Thanks for the contribution. This looks like a nice improvement to me and yeah I agree with the suggestion to move the rule a const statement rather than being in-lined. Glad to see that this project is being used!

abaga129 commented 10 months ago

@Palkess @KraXen72 This has been published as v1.1.3. Thanks!