如何从express中删除GET / POST路由器端点?

时间:2014-12-22 02:12:34

标签: node.js express

所以我定义了一个表达端点,如:

router.get('/hello', function(req, res) {
    res.send('hello');
});

稍后在代码中,我有类似的内容:

router.get('/gosilent', function(req, res) {
    // When this is called, it removes /hello endpoint 
    // such that any subsequent calls to /hello will return standard 404.
});

如何让它发挥作用?我知道如何绑定端点但是如何解除绑定呢?

我正在使用Express 4.0。

谢谢!

0 个答案:

没有答案
相关问题