express and node
// Load HTTP module
const http = require("http");
const hostname = "127.0.0.1";
const port = 8000;
// Create HTTP server
const server = http.createServer((req, res) => {
// Set the response HTTP header with HTTP status and Content type
res.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body "Hello World"
res.end('Hello World\n');
});
// Prints a log once the server starts listening
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
})
cd test-node
Also in JavaScript:
- fizzbuzz javascript
- get query param javascript
- rimraf node_modules
- jquery enforce important
- angular cli spec test false
- javascript shuffle array
- js add class
- jquery disable enter key submit
- react router tutorial medium
- get element by class
- format money javascript commas
- node js module require multiple functions from one node
- Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'.
- react native maps api key
- how to swap two images in javascript
- react router browser refresh
- how to read json file with gluegun
- react native init project
- js cound how many clicks
- jquery trigger link click
- how to access the second class of an element javascript
- jquery select self and siblings
- js clone array
- $.fn.dataTable.tables in container