Created
January 4, 2016 17:01
-
-
Save Batname/8c60599ee4eeb97fa3e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'), | |
pem = require('pem'); | |
pem.createCertificate({days:1, selfSigned:true}, function(err, keys){ | |
https.createServer({key: keys.serviceKey, cert: keys.certificate}, function(req, res){ | |
res.setHeader('Access-Control-Allow-Origin', '*'); | |
res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); | |
res.setHeader('content-type', 'text/html'); | |
res.end(`<form target="_parent" action="http://localhost:8001/shopping" class="js-search-box-form"><input class="search-box-q js-search-box-q" type="text" value="" name="q" autocomplete="off" autocorrect="off" autocapitalize="off" maxlength="2048"><input id="qo" type="hidden" name="qo" value="homeSearchBox"><button class="search-box-button" type="submit" section="hdr.search" value="">Search</button></form>`); | |
}).listen(8000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment