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`);
});
npm install xross
- Scalable 🌐
- Lightweight 🪶
- High performance 🚀
- Fast URL match 🏷️
- Full RexExp support 📜