@@ -49,6 +49,15 @@ get '/hacklabbo/state.json' do
end
get '/hacklabbo/space.json' do
+ entry = Entry.all(limit: 1, order: [ :id.desc ])
+ state = {
+ open: false,
+ date: nil
+ }
+ unless entry.empty?
+ state[:open] = entry[0][:open]
+ state[:date] = entry[0][:date]
+ end
content_type :json
{
api: "0.13",