webhook-proxy/controller/router.js

31 lines
816 B
JavaScript
Raw Permalink Normal View History

2024-03-17 00:54:52 +01:00
import express from "express";
import bodyParser from "body-parser";
import Post from "./modules/type.post.js";
export default class Router{
constructor(){
const app = express();
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json
app.use(bodyParser.json())
app.get("*",async (req,res)=>{
console.log(JSON.stringify(req.body));
res.send();
})
app.post("*",async (req,res)=>{
switch(req.body.type){
case "post":
Post.operationSelect(req.body)
break;
default:
break;
}
console.log(JSON.stringify(req.body));
res.send();
})
app.listen(7598);
}
}