inject header Access-Control-Allow-Origin: * in WMR server #889
Answered
by
marvinhagemeister
wilberforce
asked this question in
Q&A
-
Hi,
I can't find any documentation on what to set in Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
marvinhagemeister
Oct 22, 2021
Replies: 1 comment 3 replies
-
It's currently not well documented in the docs, but WMR does allow adding custom middlewares to the server: // wmr.config.mjs
import { defineConfig } from "wmr";
export default defineConfig({
middleware: [
(req, res, next) => {
res.setHeader("Access-Control-Allow-Origin", "*");
next();
}
]
}); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
wilberforce
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's currently not well documented in the docs, but WMR does allow adding custom middlewares to the server: