Skip to content

miloserdev/xross

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 📜