-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d8ca099
Showing
1 changed file
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |