回答編集履歴
2
test
answer
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
**app.js**
|
4
4
|
```lang-javascript
|
5
|
+
var fs = require('fs');
|
5
|
-
var send =
|
6
|
+
var send = fs.readFileSync('send.html');
|
6
|
-
var recv =
|
7
|
+
var recv = fs.readFileSync('recv.html');
|
7
8
|
var http = require('http').createServer(function(req, res) {
|
8
9
|
var html = (req.url === '/send') ? send : recv;
|
9
10
|
res.writeHead(200, {'Content-Type': 'text/html'});
|
1
log
answer
CHANGED
@@ -6,7 +6,6 @@
|
|
6
6
|
var recv = require('fs').readFileSync('recv.html');
|
7
7
|
var http = require('http').createServer(function(req, res) {
|
8
8
|
var html = (req.url === '/send') ? send : recv;
|
9
|
-
console.log(req.url);
|
10
9
|
res.writeHead(200, {'Content-Type': 'text/html'});
|
11
10
|
res.end(html);
|
12
11
|
});
|