0

I have built an application in Ruby on Rails where I exposed various services via APIs from my backend. The controllers for these are in a directory called ../app/v1.

Now I am planning to allow other developers to be able to built apps on top of mine and thus need to allow them to access my functionalities.

What is the best way to do this?

Should I create a new folder /app/v2 and write more controllers to expose APIs from my backend dedicated to the these developers?

I am wondering if this will violate the Don't Repeat Yourself principle but at the same time am conscious about not exposing irrelevant functionality.

Please advise. Also, I am using doorkeeper gem and planning to use grape gem for this v2 APIs. Do feel free to share if you think this is wise/unwise.

Roy
  • 277
  • 1
  • 5
  • 15

1 Answers1

1

If you want to add new and more functionality we can add this to your controller rather then API folder. To maintain DRY you can use concern feature of rails 4.

Please check this answer about how to use concern.

How to use concerns in Rails 4

Community
  • 1
  • 1
Md Sirajus Salayhin
  • 4,246
  • 5
  • 30
  • 44