JKHeadley / rest-hapi

🚀 A RESTful API generator for Node.js
https://resthapi.com
MIT License
1.19k stars 153 forks source link

How can we perform API versioning #91

Open arunkatariaoodles opened 6 years ago

arunkatariaoodles commented 6 years ago

I am using your rest-hapi module of 0.23.2 version and stuck in versioning the API, So please guide me, how can I perform versioning in this module.

JKHeadley commented 6 years ago

Hi @arunkatariaoodles, you can set the api version with the config.version property.

arunkatariaoodles commented 6 years ago

Hi @JKHeadley, as if i use ExpressJs, in that case, I can use "http://localhost:9000/V1/user" get API in version 1 and if I will update some changes in user API version 2 I will use this "http://localhost:9000/V2/user" so in that case, I can use both the API just by changing V1 to V2. So is there any option so that I can use Rest-Hapi get API with V1 to V2.

JKHeadley commented 6 years ago

@arunkatariaoodles unfortunately this feature doesn't exist currently, however I'm open to adding it in the future.

fabripeco commented 5 years ago

It would be nice to have at least a baseUrl to prefix the API endpoint (e.g /api/login instead of /login). Is this feature available? Thank you!