Skip to content

Commit 09cdcc1

Browse files
committed
Update README.md
1 parent 9723cac commit 09cdcc1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,14 +1141,14 @@ Common use for the File System module:
11411141
* Delete files
11421142
* Rename files
11431143

1144-
**Read Files**
1145-
index.html
1144+
**Example:** Read Files
11461145

11471146
```html
1147+
<!-- index.html -->
11481148
<html>
11491149
<body>
1150-
<h1>My Header</h1>
1151-
<p>My paragraph.</p>
1150+
<h1>File Header</h1>
1151+
<p>File Paragraph.</p>
11521152
</body>
11531153
</html>
11541154
```
@@ -1159,19 +1159,14 @@ index.html
11591159
*/
11601160
const http = require('http');
11611161
const fs = require('fs');
1162+
11621163
http.createServer(function (req, res) {
11631164
fs.readFile('index.html', function(err, data) {
11641165
res.writeHead(200, {'Content-Type': 'text/html'});
11651166
res.write(data);
11661167
res.end();
11671168
});
1168-
}).listen(8080);
1169-
```
1170-
1171-
Initiate read_file.js:
1172-
1173-
```js
1174-
node read_file.js
1169+
}).listen(3000);
11751170
```
11761171

11771172
<div align="right">

0 commit comments

Comments
 (0)