Posted On: Feb 22, 2018
CORS stands for Cross-Origin Resource Sharing. It a is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin.
Use below code to enable CORS on NodeJS
app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); });
Never Miss an Articles from us.
Node Js is one of the most popular and powerful server technologies today. It allows you built the entire website only..
CLI stands for Command Line Interface. It is a utility or program on your computer where users type commands to perform..
Node js is written in C, C++,JavaScript.It uses Google’s open source V8 Javascript Engine to convert Javascript code..