【发布时间】:2022-01-20 22:08:20
【问题描述】:
我希望方法是动态的
const method = METHODS?.[config.method] ?? 'get';
const endpoint = config.endpoint;
const router = express.Router();
这行得通
app['post'](endpoint, execute);
这不行
app[method](endpoint, execute);
【问题讨论】:
标签: node.js express routes router