Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 798 Bytes

README.md

File metadata and controls

34 lines (28 loc) · 798 Bytes

xross

A simple NodeJS HTTP/HTTPS web router

const http = require("http");
const Xross = require("xross");
const app = Xross({ body_parser: true, debug: true });

app.route("/*", { method: "ANY" }, (req, res, next) => {
	res.setHeader('Content-Type', 'application/json');
	res.writeHead(200);
	res.end( JSON.stringify({ "response": "working" }) );
	next();
});

const server = http.createServer(app);
server.listen(port, host, () => {
	console.log(`Server is running`);
});

Install

npm install xross

Features

  • Scalable 🌐
  • Lightweight 🪶
  • High performance 🚀
  • Fast URL match 🏷️
  • Full RexExp support 📜