Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 11 gives seemingly nonsense error #150

Open
ghost opened this issue Nov 24, 2014 · 0 comments
Open

Exercise 11 gives seemingly nonsense error #150

ghost opened this issue Nov 24, 2014 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 24, 2014

My original solution to exercise 11 didn't pipe the filestream to the output. Instead it read the file into a variable and then served it. The solution was rejected for a most unhelpful reason:

Used fs method other than fs.createReadStream(): fs.createReadStream()

You probably want to change this to something more informative.

The entire problematic solution is below. Again, I don't need help solving the exercise, I'm just informing you of the weird error message.

var http = require('http')
var fs = require('fs')

var port = process.argv[2];
var path = process.argv[3];
var file = ""
var filestream = fs.createReadStream(path, function(err, chunk){
  file += chunk;
})

http.createServer(function (res, rep) {
  rep.end(file);
}).listen(port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant