rapidjs / rapid.js

An ORM-like Interface and a Router For Your API Requests
https://rapidjs.drewjbartlett.com
710 stars 45 forks source link

Config option to use file extensions #8

Closed bajzarpa closed 7 years ago

bajzarpa commented 7 years ago

Is there a way, or you planning to implement a config option where i can set a file extension prefix?

I wanted to try this library a project of mine, but the API (Redmine) which i'm using is not following the REST standards at all. In my case, an url looks like this: //example.com/issues/3.json or //example.com/users.json so i always have to specify the file extension, but in the docs i have not found option to to do this.

drewjbartlett commented 7 years ago

You could build a wrapper around rapid that could do this for you: http://rapidjs.io/docs#extending-making-a-wrapper. But I see what you mean about it being on every request that you pass the the config. We can make this a feature request to get out there soon!

drewjbartlett commented 7 years ago

@bajzarpa Been quite some time, but I finally got around to adding the extension feature. http://rapidjs.io/docs#configuration-extension