From d8ca099a3397448a84ce546add53bba7d85b9e7b Mon Sep 17 00:00:00 2001 From: OriolFalip Date: Thu, 8 Apr 2021 10:42:26 +0200 Subject: [PATCH] first commit --- app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app.js diff --git a/app.js b/app.js new file mode 100644 index 0000000..ebec2e3 --- /dev/null +++ b/app.js @@ -0,0 +1,10 @@ +const http = require('http'); //Import http module + +//Creating a server +//Using arrow functions +const server = http.createServer((req,res)=>{ + console.log('Hello from the server'); +}); //Our server is now created and when a request is recieved, it executes the requestListener function. +//However, there is no way we can send it a request, because it is not listening. + +server.listen(3000); //In order to send it a request, it must be listening to a Port (3000 in this case) \ No newline at end of file