Access to XMLHttpRequest at 'https://xmlrpc.terwergreen.com/api/xmlrpc' from origin 'https://nextjs.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. _app-4ccd7c9a287b6dc7.js:1 GET https://xmlrpc.terwergreen.com/api/xmlrpc net::ERR_FAILED 200
// Initialize the cors middleware const cors = initMiddleware( // You can read more about the available options here: https://github.com/expressjs/cors#configuration-options Cors({ // Only allow requests with GET, POST and OPTIONS methods: ['GET', 'POST', 'OPTIONS'], }) )
exportdefaultasyncfunctionhandler(req, res) { // Run cors awaitcors(req, res)
// Rest of the API logic res.json({ message: 'Hello Everyone!' }) }