-1
私はこのコードから私のhttpサーバを起動したい:Learnyounode httpサーバECONNREFUSED
var http = require('http')
var fs = require('fs')
var port = 8080
var fileName = "test"
http.createServer(function (request, response) {
fs.createReadStream(fileName).pipe(response)
}).listen(port)
をしかし、私は実行したいとき、私はこの出力を得る:
✗ Error connecting to
(http://localhost:25066/api/parsetime?iso=2017-12-02T14:50:54.063Z): connect ECONNREFUSED 127.0.0.1:25066
✗ Error connecting to
(http://localhost:25066/api/unixtime?iso=2017-12-02T14:50:54.063Z): connect ECONNREFUSED 127.0.0.1:25066
問題は何を?
エラーが発生した場合は、ポート ':25066'に接続しようとしていますが、サーバが':8080'で実行しています。 – Acidic
'listen'引数がありません – Saran