Created
November 12, 2015 16:42
-
-
Save 0xadada/34df9d97c268f27594c9 to your computer and use it in GitHub Desktop.
Node apps
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 http = require('http'); | |
var s = http.createServer( function( request, response ) { | |
response.writeHead(301, { | |
'Content-Type': 'text/plain; charset=utf8', | |
'Location': 'view-source://visual-assault.org/' | |
}); | |
response.write( 'hello world\n' ); | |
console.info( '[INFO]', 'user-agent', request.headers['user-agent'] ); | |
} ); | |
s.listen( 8000 ); | |
console.info( '[INFO]', 'Server listening on port 8000' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment