Node.js: simple web server
An example: Webserver This simple web server written in Node responds with "Hello World" for every request. var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/' ); To run the server, put the code into a file example.js
| Penerbit | Taratsa |
|---|---|
| Tahun | 2014-11-28 |
| Bahasa | ind |
| Pengenal | bookid: urn:uuid:f50b0d29-e20c-5e41-8fa4-a3bf1d6a0c49 |