Skip to content

http.createServer(function (req, res) {Issue closed as no further information was provided #20

@kyela999

Description

@kyela999

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");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions