We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ceaeee commit be60803Copy full SHA for be60803
comments.js
@@ -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