webhook-proxy/controller/router.js
2024-03-17 01:01:22 +01:00

31 lines
816 B
JavaScript

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);
}
}