Browse Source

ctrl+c ctrl+v

encrypt 8 years ago
parent
commit
6768435a7a
1 changed files with 9 additions and 0 deletions
  1. 9 0
      webapp.rb

+ 9 - 0
webapp.rb

@@ -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",