使用以下路由,我无法在/src/templates/images
目录中提供该静态文件(图像)。
const routerImages = app.route('/assets/ti');
routerImages.use(require('express').static(__dirname + '/src/templates/images'));
请注意,在这种情况下,app
是指probot(GitHub Apps框架)应用程序对象。
我已经看到了类似的问题,但是不知何故,我无法运行它。
在localhost(本地开发环境)上有效。因此,我很确定问题出在静态目录引用(__dirname ...)中。