I am writing a little demo web server delivering static html,css and javascript. The server looks like
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var server = http.createServer(app);
server.listen(9999, function () {
console.log('server is listening');
});
})();
My client side javascript makes ajax calls to a different server. How can I add
Access-Control-Allow-Origin: http://example.com
to my server response, so that the client side javascript can do the ajax call?