DoubleSpout/rrestjs

response.file建议

a272121742 opened this issue · 1 comments

response.file没有像response.render方法一样查找配置路径,因此代码可能会很长,就像这样:

    response.file('/view/static/html/user/login.html');

而实际上config文件中是已经配置过staticFolder:'/view/static',此处可以在源码中加入,使得以上代码变为:

    response.file('/html/user/login.html');

进行有必要的约束是很不错的,这样file只能找static,render只能找template,屏蔽../等,就能做到有效和规范

发送图片不一定要是static里的,可能是其他地方的图片,需要开发者自己把握了