Skip to content

Commit be60803

Browse files
committed
Copilot third commit
1 parent 0ceaeee commit be60803

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

comments.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Create Web Server
2+
// Create a web server that listens on port 3000 and serves the comments.html file
3+
// when someone visits http://localhost:3000/comments.
4+
// Use the fs module to read the comments.html file and serve it back to the user.
5+
// Use the http module to create the server.
6+
7+
const http = require('http');
8+
const fs = require('fs');
9+
const path = require('path');
10+
11+
const server = http.createServer((req, res) => {
12+
console.log(`Request made to ${req.url}`);
13+
14+
if (req.url === '/comments') {
15+
fs.readFile(path.join(__dirname));}
16+
});

0 commit comments

Comments
 (0)