Преглед на файлове

refactored to add else clause

Sergey Zavadski преди 11 години
родител
ревизия
dccd8dc999
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  1. 1 3
      leda/app.lua

+ 1 - 3
leda/app.lua

@@ -5,9 +5,7 @@ local server = http.Server(8080, '')
 server.request = function(server, request, response)
     if request:url():find('/json') then
         response.body =  {message= 'Hello, World!'}
-    end
-    
-    if request:url():find('/plaintext') then
+    elseif request:url():find('/plaintext') then    
         response.body =  'Hello, World!'
     end
 end