* Play API prototype * Web app * Drag and drop support * Handle different urls * Fix redirect * Increase max connections * changelog * Limit timeout * Use fetch * Redirects * Formatting
28 lines
683 B
Plaintext
28 lines
683 B
Plaintext
namespace Http
|
|
|
|
class HttpDefaultRouter extends HttpRouter
|
|
|
|
function new()
|
|
super()
|
|
|
|
m.All("*", function(context as object) as boolean
|
|
request = context.request
|
|
response = context.response
|
|
|
|
method = request.method
|
|
uri = request.uri
|
|
|
|
if method = ""
|
|
response.Default(400, "You sent a request that the server couldn't understand.")
|
|
else
|
|
response.Default(404, `Cannot ${method} ${uri}`)
|
|
end if
|
|
|
|
return true
|
|
end function)
|
|
end function
|
|
|
|
end class
|
|
|
|
end namespace
|