Changelog
ambiorix 2.1.0.9000
- Added
cache_templates
method to cache templates in memory. - Added
use_html_template
to usehtmltools::htmlTemplate
as rendering. - Custom renderers (
as_renderer
) are now more robust.
ambiorix 2.1.0
Breaking
Response
methodstatus
renamed toset_status
(this is to allow havingstatus
as a field).
Changes
- Improve rendering of templates. No longer force render data as JSON if using an HTML template.
- Allow nested partials, their path must be relative.
- Added
jobj
function to serialise objects to JSON inrender
. - Allow passing
host
andport
tostart()
method. - Added
host
andport
active bindings. - Move internal
is_running
field to private. - Added
status
active binding onResponse
. - Added
get_header
,set_header
, andset_headers
toResponse
. - Allow adding multiple cookies to the request.
- Add
parseCookie
JavaScript helper function to JavaScript file. - Allow customising the cookie parser with
as_cookie_parser
. - Allow adding cookie value preprocessors with
as_cookie_preprocessor
. - Arguments to
cookie
method onResponse
take options. - Added
clear_cookie
method toResponse
- Cookies of the same name overwrite rather than duplicate.
- Added
content_*
family of convenience function to set content type headers. - Export
serialise
- Fixed issue where wrong path pattern was matched.
- Catch error if no route is specified.
- Do not force body to character fixes #44
- Do no force content type on response fixes #45
- Deprecate passing headers to
response
orsend
-like functions, useheader
method. - Deprecate
set_header
in favour ofheader
method. - Added family of
header_content*
methods to easily setContent-Type
. - Request
HEADERS
is always alist
. - Deprecate
set
andget
on Response and Request, this is no longer needed the environments are no longer locked;res$myVar <- 2L
. - Deprecate
status
argument of responses, the active binding should be used instead;res$status <- 404L
. - Partially improved route matching.
- Allow customising the path to pattern converter.
- Added
get_header
method to the retrieve a specific method. - Fix htmlwidget response.
- Added
image
,png
andjpeg
methods toResponse
to serve images. - Added
ggplot2
method toResponse
. - Allow
use
method onRouter
these will only be applied to paths of said router. - Added
parse_*
methods to theRequest
. - Cookie
path
defaults to/
. - Fix default serialiser
- More robust
parser_*
methods and fuctions. - Empty cookie is empty list instead of empty string.
- Added
mockRequest
to for testing purposes. - Fixed
port
,host
, andwebsocket
active bindings. - Add ability to create custom renderer, see jader, and pugger.
ambiorix 2.0.0
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.
ambiorix 1.0.2
- Reaches CRAN
- Removed
create_ambiorix
, see ambiorix.generator. - Removed
add_template
, see ambiorix.generator. - Deprecate the
Logger
class in favour of the log package. - Fixed
parse_json
#36
ambiorix 1.0.1
- Deprecate
create_ambiorix
: moving to ambiorix.generator package. - Deprecate
add_template
: moving to ambiorix.generator package. - Added
all
method to define route and handler for all methodsGET
,POST
,PUT
,DELETE
, andPATCH
. - The
use
method now accepts a function which is run every time the server receives a request. - Add
set
andget
to request to add and retrieve params (namely with the middleware) - Fix
check_installed
, see #33
ambiorix 1.0.0
Initial version.