Belgae
Breaking change
The render
and send_file
methods of the Response
object now
expect the full path to the template, with the file extension.
Where one would before res$render("home")
, now one
res$render("templates/home.html")
.
Similarly, in said templates, to import partials,
use full path relative to the template in which the partial is used
e.g.: from [! header.html !]
to
[! partials/header.html !]
.
Changes
- Middleware no longer uses global environment that may cause side effect
across sessions. set
andget
methods on request store in environment to allow
locking variables when usingset
.- Better instructions for deploying as a service.
- Remove the deprecated
Logger
class, see log package. - Pass
host
to free port fetch function. - Add hidden option to force change port for upcoming related service.
- Internals of calls reworked to share response object.
This is how it should always have worked, it allows middlewares to
updatre request and response to be used/passed to subsequent calls. - Middleware check for run has been fixed.
- Document and export the
Response
class. - Added pre-hook to response.
- Document and export
Request
class. set
andget
methods onRequest
andResponse
accept character
strings asname
.- Use R 4.1.0 + add
Depends
- Allow passing a list of functions to
use
to easily se multiple
middlewares at once. render
method correctly sets theContent-type
header.headers
method more robust to avoid duplicated headers.- Add
token_create
function. - Add
cookie
method to theResponse
class to easily set cookies. - Add
cookie
field toRequest
to hold parsedHTTP_COOKIE
. - Properly URL decode query string values.
- Add
sendf
method toResponse
class to pre-process request
withsprintf
. - Silently read templates, no more EOF warnings.
- More informative print messages for classes.
- Add post render hooks to response.
- Added
get_headers
method toResponse
to retrieve currently set headers. - Unlock objects to allow adding new elements to
Response
andRequest
. - Upgrade websocket protocol if on HTTPS protocol.
- Improved the default log.
log
argument of ambiorix constructor now defaults toTRUE
.- Added
md
method toResponse
to render.md
files. - Added
set_log*
functions to allow using custom logs.