因为想要写一个环境为debug时能同时接收 get和post 请求的方法(环境为production时则只接收post),所以想找到express里面的post方法,把它们写到一起去,但是找了两天没找到post在哪...然后终于找到,好像这个方法是http模块的,那我想给express加个方法,该写在哪?开头怎么写?想要和现有的router.get和router.post用法一样
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
写中间件就行了呀,中间件的内容就是 debug + 处理post、get。