Answers for "Access-Control-Allow-Origin apache"

0

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();
  });
Posted by: Guest on June-15-2021
0

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.                                                       #
Posted by: Guest on March-29-2020
0

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;
Posted by: Guest on July-20-2021

Code answers related to "Access-Control-Allow-Origin apache"

Browse Popular Code Answers by Language