Krakenjs如何将除api调用之外的所有请求路由到index.html?

如何将所有请求路由到index.html,除了一些API调用和一些页面。 因为kraken路由的方式是基于控制器的目录,所以如果我这样做

// /controller/index.js app.get('*', function(){ res.sendFile(__dirname + '/public/index.html'); }); 

kraken会把我所有的请求路由到index.html,包括/ controller / api目录下的api调用。 所以我怎样才能让kraken把/ api这样的请求路由到/controller/api/index.js,其余的到/public/templates/index.html?

我把它作为中间件之后的路由器(使用优先级,以确保它结束在正确的地方)

 module.exports = function setupJustServeTheAppEverywhere() { return function (req, res, next) { res.sendFile(__dirname + '/public/index.html'); } }; 

并有configuration负载。