Add ServeRedirect function to redbean Lua (#246)

This commit is contained in:
Paul Kulchenko 2021-08-17 14:26:33 -07:00 committed by GitHub
parent 3d0347e26e
commit 4486ad5c9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 2 deletions

View file

@ -1005,13 +1005,18 @@ FUNCTIONS
causes what would normally happen outside a dynamic handler to
happen. The asset can be sourced from either the zip or local
filesystem if -D is used. This function is mutually exclusive with
SetStatus and ServeError.
SetStatus and other Serve* functions.
ServeError(code:int[,reason:str])
Instructs redbean to serve a boilerplate error page. This takes
care of logging the error, setting the reason phrase, and adding a
payload. This function is mutually exclusive with SetStatus and
ServeAsset.
other Serve* functions.
ServeRedirect(code:int,location:str)
Instructs redbean to return the specified redirect code along with
the Location header set. This function is mutually exclusive with
SetStatus and other Serve* functions.
SetLogLevel(level:int)
Sets logger verbosity. Reasonable values for level are kLogDebug >