We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Issue is TypeError: http.createServer is not a function
_Originally posted by @nic11 in #14 (comment) _const fs = require("fs"); const http =("http"); const server = http.createServer(); server.on('request', (req, res) => { const rstream = fs.creatReadStream("input.txt"); rstream.on("data", (chunkdata) => { res.write(chunkdata); }); rstream.on("end", () =>{ }); rstream.on('error', (err) => { console.log(err); res.end("file is not found"); }); }); server.listen(8000,"127.0.0.1");
The text was updated successfully, but these errors were encountered:
TypeError: http.createServer is not a function
Sorry, something went wrong.
First of all, please use Markdown to properly format code snippet. E.g., see examples -> code here: https://guides.github.com/features/mastering-markdown/
Or fenced code blocks here: https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf
I can see at least two typos:
const http =("http");
require
const rstream = fs.creatReadStream("input.txt");
internal/modules/cjs/loader.js:883 throw err; Error: Cannot find module '/home/rinku/nodedex/index.js' in this code after corect this error show
_const fs = require("fs"); const http =("http"); const rstream = fs.creatReadStream("input.txt"); const server = http.createServer(); server.on('request', (req, res) => {
rstream.on("data", (chunkdata) => { res.write(chunkdata); }); rstream.on("end", () =>{ }); rstream.on('error', (err) => { console.log(err); res.end("file is not found"); }); }); server.listen(8000,"127.0.0.1");
No branches or pull requests
Issue is TypeError: http.createServer is not a function
_Originally posted by @nic11 in #14 (comment)
_const fs = require("fs");
const http =("http");
const server = http.createServer();
server.on('request', (req, res) => {
const rstream = fs.creatReadStream("input.txt");
rstream.on("data", (chunkdata) => {
res.write(chunkdata);
});
rstream.on("end", () =>{
});
rstream.on('error', (err) => {
console.log(err);
res.end("file is not found");
});
});
server.listen(8000,"127.0.0.1");
The text was updated successfully, but these errors were encountered: