Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CORS #2564

Answered by bashmish
quentinmazoua asked this question in Ideas
Discussion options

Hi,

I'm just moving from the old es-dev-server and I was using the CORS option but this is no longer available with web-dev-server.

You must be logged in to vote

I figured you are referring to https://github.com/open-wc/es-dev-server/blob/98dd47464c97c5ab5fc6ef86723b3f529bc8265c/src/config.ts#L60

Not sure why this feature is not supported natively here, but given it was in the project which WDS was forked from (and is written by same authors), I assume it was removed on purpose. Maybe @LarsDenBakker can add more details?

But don't worry, it's very easy to add it yourself, I'd say so easy that you might not need it out-of-the-box.

Just install and use the import koaCors from '@koa/cors'; and add it to middleware which is an array of Koa middlewares
https://modern-web.dev/docs/dev-server/middleware/#dev-server-middleware
similar to
https://github.co...

Replies: 1 comment

Comment options

I figured you are referring to https://github.com/open-wc/es-dev-server/blob/98dd47464c97c5ab5fc6ef86723b3f529bc8265c/src/config.ts#L60

Not sure why this feature is not supported natively here, but given it was in the project which WDS was forked from (and is written by same authors), I assume it was removed on purpose. Maybe @LarsDenBakker can add more details?

But don't worry, it's very easy to add it yourself, I'd say so easy that you might not need it out-of-the-box.

Just install and use the import koaCors from '@koa/cors'; and add it to middleware which is an array of Koa middlewares
https://modern-web.dev/docs/dev-server/middleware/#dev-server-middleware
similar to
https://github.com/open-wc/es-dev-server/blob/98dd47464c97c5ab5fc6ef86723b3f529bc8265c/src/create-middlewares.ts#L204

You must be logged in to vote
0 replies
Answer selected by quentinmazoua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /