Browse Source

id is now 12 bytes

encrypt 4 years ago
parent
commit
5adb4a07fb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      server/server.rb

+ 2 - 1
server/server.rb

@@ -5,7 +5,7 @@ require 'json'
 # create a room
 
 post '/room' do
-  id = SecureRandom.hex(4)
+  id = SecureRandom.hex(6)
   Dir.mkdir(id)
   content_type 'text/json'
   {id: id}.to_json
@@ -49,4 +49,5 @@ end
 # remove a file
 
 delete '/room/:id/:filename' do |id, filename|
+  FileUtils.rm("./"+id+"/"+filename)
 end