liquid_feedback_frontend
view env/request/router.lua @ 1501:caaccdb20d0c
Updated italian translation
| author | bsw | 
|---|---|
| date | Mon Jun 08 13:49:15 2020 +0200 (2020-06-08) | 
| parents | 71f54c43d7cb | 
| children | 45fd259aa1ad | 
 line source
     1 local api_endpoints = {
     2   instance = true,
     3   navigation = true,
     4   style = true,
     5   application = true,
     6   info = true,
     7   member = true,
     8   notify_email = true,
     9   profile_info = true,
    10   profile = true,
    11   settings_info = true,
    12   settings = true,
    13   event = true,
    14   support = true,
    15   embed_initiative = true
    16 }
    18 function request.router()
    20   local api_prefix = "api/1/"
    22   local path = request.get_path()
    24   if path == api_prefix .. "register" then
    25     return { module = "oauth2", view = "register" }
    26   elseif path == api_prefix .. "authorization" then
    27     return { module = "oauth2", view = "authorization" }
    28   elseif path == api_prefix .. "token" then
    29     return { module = "oauth2", view = "token" }
    30   elseif path == api_prefix .. "validate" then
    31     return { module = "oauth2", view = "validate" }
    32   elseif path == api_prefix .. "session" then
    33     return { module = "oauth2", view = "session" }
    34   else
    35     local endpoint = string.match(path, "^" .. api_prefix .. "(.*)$")
    36     if api_endpoints[endpoint] then
    37       return { module = "api", view = endpoint }
    38     end
    39   end
    41   return request.default_router(path)
    43 end
