Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to remove cors error from node app

app.use(function(req, res, next) {
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
    res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
    res.setHeader('Access-Control-Allow-Credentials', true);
    next();
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to remove a class in js after 100 milliseconds 
Javascript :: remove session storage 
Javascript :: node js procfile heroku starter 
Javascript :: javascript convert seconds to minutes seconds 
Javascript :: append before jquery 
Javascript :: javascript disable scrolling on body 
Javascript :: select2 on change 
Javascript :: slider is not a function jquery 
Javascript :: react native android build 
Javascript :: how to install font-awesome 
Javascript :: jquery after seconds 
Javascript :: how to completely reload page in jquery 
Javascript :: set value in span using jquery 
Javascript :: how to get element by attribute value in javascript 
Javascript :: get age using moment 
Javascript :: how to imporrt Browserrouter in react 
Javascript :: settimeout es6 
Javascript :: download canvas as image 
Javascript :: update nodejs version in ubuntu 
Javascript :: javascript-find-json-value 
Javascript :: javascript detect mobile device 
Javascript :: validador de cep javascript 
Javascript :: display none using jquery 
Javascript :: check undefined object javascript one liner set to emtpy 
Javascript :: UnhandledPromiseRejectionWarning: Error: Node is either not clickable or not an HTMLElement 
Javascript :: select2 get selected value 
Javascript :: express set views directory 
Javascript :: fetch await 
Javascript :: javascript click 
Javascript :: jquery get base url 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =