0.0.8 • Published 6 months ago
http-server-clone v0.0.8
HttpServerClone
HttpServerClone is a lightweight npm package that provides a simple clone of Express.js but with a TCP server. It allows you to handle basic routing for TCP requests in a manner similar to how Express.js handles HTTP requests.
THIS PROJECT IS ONLY FOR LEARNING DO NOT USE THIS PACKAGE AT PRODUCTION
Installation Guide
install package using npm
npm i http-server-clone
Usage
const { httpServerClone } = require("http-server-clone");
const app = httpServerClone();
app.get("/getTest", (req, res) => {
res.status(200).send("YEAHH");
});
app.get("/getJson", (req, res) => {
res.status(200).json({ message: "JSON WORKING" });
});
app.listen("8080", () => {
console.log("Sever Running on 8080");
});
Currently Supported Methods : GET, POST, DELETE, PUT, PATCH
Github & Linkedin
Contributing & Usage
Contributions are always welcome!
Make a pull request or raise an issue.