diff --git a/app/controllers/v1/pages_controller.rb b/app/controllers/v1/pages_controller.rb index 32e9bc3..97ad60b 100644 --- a/app/controllers/v1/pages_controller.rb +++ b/app/controllers/v1/pages_controller.rb @@ -2,4 +2,8 @@ class V1::PagesController < ApiController def index end + + def revision + @revision = `git rev-parse --short HEAD` + end end diff --git a/app/views/v1/pages/revision.json.jbuilder b/app/views/v1/pages/revision.json.jbuilder new file mode 100644 index 0000000..89170c6 --- /dev/null +++ b/app/views/v1/pages/revision.json.jbuilder @@ -0,0 +1 @@ +json.revision @revision \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 6cd9e18..383bfeb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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