You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
748 B

8 years ago
8 years ago
8 years ago
  1. module Mastodon
  2. class Rest < Grape::API
  3. version 'v1', using: :path
  4. format :json
  5. resource :statuses do
  6. desc 'Return a public timeline'
  7. get :all do
  8. present Status.all, with: Mastodon::Entities::Status
  9. end
  10. desc 'Return the home timeline of a logged in user'
  11. get :home do
  12. # todo
  13. end
  14. desc 'Return the notifications timeline of a logged in user'
  15. get :notifications do
  16. # todo
  17. end
  18. end
  19. resource :accounts do
  20. desc 'Return a user profile'
  21. params do
  22. requires :id, type: String, desc: 'Account ID'
  23. end
  24. get ':id' do
  25. present Account.find(params[:id]), with: Mastodon::Entities::Account
  26. end
  27. end
  28. end
  29. end