Skip to content

Commit 9723cac

Browse files
committed
Update index.md
1 parent 238e502 commit 9723cac

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

index.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ Common use for the File System module:
181181
* Delete files
182182
* Rename files
183183

184-
**Read Files**
185-
index.html
184+
**Example:** Read Files
186185

187186
```html
187+
<!-- index.html -->
188188
<html>
189189
<body>
190-
<h1>My Header</h1>
191-
<p>My paragraph.</p>
190+
<h1>File Header</h1>
191+
<p>File Paragraph.</p>
192192
</body>
193193
</html>
194194
```
@@ -199,19 +199,14 @@ index.html
199199
*/
200200
const http = require('http');
201201
const fs = require('fs');
202+
202203
http.createServer(function (req, res) {
203204
fs.readFile('index.html', function(err, data) {
204205
res.writeHead(200, {'Content-Type': 'text/html'});
205206
res.write(data);
206207
res.end();
207208
});
208-
}).listen(8080);
209-
```
210-
211-
Initiate read_file.js:
212-
213-
```js
214-
node read_file.js
209+
}).listen(3000);
215210
```
216211

217212
<div align="right">

0 commit comments

Comments
 (0)