Resource middleware improvements

* added basic test
* return a file path instead of a file url
* return result in resource-path slot
* improve descriptor