rajendrajaiswal | 117e598 | 2019-07-30 09:54:29 +0000 | [diff] [blame] | 1 | var httpServer = function() { |
| 2 | var http = require('http'), |
| 3 | url = require('url'), |
| 4 | fs = require('fs'), |
| 5 | |
| 6 | start = function(port) { |
| 7 | var server = http.createServer(function(req, res) { |
| 8 | processHttpRequest(res); |
| 9 | }); |
| 10 | server.listen(port, function() { |
| 11 | console.log('Listening on ' + port + '...'); |
| 12 | }); |
| 13 | }, |
| 14 | |
| 15 | processHttpRequest = function(res) { |
| 16 | res.writeHead(200, {'Content-Type': 'text/plain'}); |
| 17 | res.end('Published Successfully.\n'); |
| 18 | }; |
| 19 | |
| 20 | return { |
| 21 | start: start |
| 22 | } |
| 23 | }(); |
| 24 | |
| 25 | httpServer.start(3904); |