1import type { Request } from "express"; 2 3export default function getParams(req: Request): { [param: string]: any } { 4 if (req?.method == "POST") { 5 return new Proxy( 6 {}, 7 { 8 get(_, key) { 9 return req.body?.[key]; 10 }, 11 }, 12 ); 13 } else { 14 // only support params for POST requests. 15 return {}; 16 } 17} 18 19