Skip to content

Commit

Permalink
server done
Browse files Browse the repository at this point in the history
  • Loading branch information
MRMutahir committed Aug 3, 2023
0 parents commit 390c5ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { error } = require('console');
const http = require('http');
const url = require('url');
let server = http.createServer((req,res)=>{
if (req.url === '/') {
res.end('server Run!');
}else if (req.url === '/about') {
res.end('server Run About ! ');

}else if(req.url === '/contact'){
res.end('server Run contact ! ');

}else{
// console.log(error,'server not run ?');
res.end('incorect url')
}
});
let port = 8000
server.listen(port,'127.0.0.1',()=>{
console.log(`listen to server ${port}`);
})
1 change: 1 addition & 0 deletions text
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
My first server create Node.js.

0 comments on commit 390c5ef

Please sign in to comment.