Skip to content

inject header Access-Control-Allow-Origin: * in WMR server #889

Discussion options

You must be logged in to vote

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();
    }
  ]
});

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wilberforce
Comment options

@marvinhagemeister
Comment options

@wilberforce
Comment options

Answer selected by wilberforce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants