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 ๐