diff --git a/src/actions/version/index.cr b/src/actions/version/index.cr new file mode 100644 index 0000000..31c469d --- /dev/null +++ b/src/actions/version/index.cr @@ -0,0 +1,7 @@ +class Version::Index < BrowserAction + include Auth::AllowGuests + + get "/version" do + plain_text "Deployed version: #{College::VERSION}" + end +end diff --git a/src/start_server.cr b/src/start_server.cr index b5b92e5..fcb282f 100644 --- a/src/start_server.cr +++ b/src/start_server.cr @@ -13,5 +13,9 @@ Signal::INT.trap do app_server.close end +module College + VERSION = {{ `git rev-parse --short HEAD`.chomp.stringify }} +end + STDERR.puts "Listening on #{ENV["HOST"]}:#{ENV["PORT"]}" app_server.listen