Answers for "options request cors"

17

Enable All CORS Requests

var express = require('express')
var cors = require('cors')
var app = express()

app.use(cors())

app.get('/products/:id', function (req, res, next) {
  res.json({msg: 'This is CORS-enabled for all origins!'})
})

app.listen(80, function () {
  console.log('CORS-enabled web server listening on port 80')
})
Posted by: Guest on March-24-2020
0

list of cors headers for https

@Override
			public void addCorsMappings(CorsRegistry registry) {
				registry.addMapping("/**").allowedOrigins("*")
						.allowedMethods("GET", "PUT", "POST", "PATCH", "DELETE", "OPTIONS")
						.allowedHeaders("Content-Type", "api_key", "Authorization", "X-Requested-With");
			}
Posted by: Guest on June-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language