API services are exposed using Grape
middleware.
The API handlers are available in lib/api
directory.
The following route mounts Grape Swachalit API which in turn mounts other routes:
mount ::API::Swachalit => '/api-v2'
- Create resource file under
lib/api
- Include the file in
lib/api/swachalit.rb
- Mount the resource class
See lib/api/event.rb
and lib/api/swachalit.rb
for reference.