Skip to content

Commit

Permalink
Add revision endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
thekeenant committed Dec 2, 2023
1 parent b15ae0f commit d460bf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/v1/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ class V1::PagesController < ApiController
def index

end

def revision
@revision = `git rev-parse --short HEAD`
end
end
1 change: 1 addition & 0 deletions app/views/v1/pages/revision.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
json.revision @revision
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@
get 'explore/courses', to: 'explore#courses', as: :explore_courses
get 'explore/subjects', to: 'explore#subjects', as: :explore_subjects
get 'explore/instructors', to: 'explore#instructors', as: :explore_instructors

get 'revision', to: 'pages#revision'
end
end

0 comments on commit d460bf9

Please sign in to comment.