Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolFalip committed Apr 8, 2021
0 parents commit d8ca099
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit d8ca099

Please sign in to comment.