access-control-allow-origin
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
access-control-allow-origin
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
apache2 CORS
##### WORKING ON APACHE2 Unix CONFIGURATION #####
# To learn more about CORS : #
# https://fr.wikipedia.org/wiki/Cross-origin_resource_sharing #
# First you need to enable headers_module in your global Apache2 #
# httpd.conf configuration file. To do so, uncomment the line #
LoadModule headers_module modules/mod_headers.so
# Once it's done, you need to parameter the following statements #
# in your dedicated <Directory> , <Location> , <Files> #
# or <VirtualHost> .conf file, or inside your project within #
# .htaccess file #
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE"
Header set Access-Control-Allow-Headers "Origin, Content-Type, X-Auth-Token"
# Finally restart your apache server. #
# You are free to manipulate other statements, referenced #
# into the wiki. #
# This has for effect to manipulate default HTTP Headers sent by #
# your server, in order to communicate with a remote client #
# browser. #
set Access-Control-Allow-Origin header to * cors
var config = {
development: {
//url to be used in link generation
url: 'http://my.site.com',
//mongodb connection settings
database: {
host: '127.0.0.1',
port: '27017',
db: 'site_dev'
},
//server details
server: {
host: '127.0.0.1',
port: '3422'
}
},
production: {
//url to be used in link generation
url: 'http://my.site.com',
//mongodb connection settings
database: {
host: '127.0.0.1',
port: '27017',
db: 'site'
},
//server details
server: {
host: '127.0.0.1',
port: '3421'
}
}
};
module.exports = config;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us