@alterior/express
Advanced tools
Changelog
🚀 3.0.0-rc.9
@/web-server
: The message attached to HttpError
will now hint that you shouldn't be catching this error, since
it's used for aborting the active request and sending an HTTP status codse@/web-server
: When WebServer.for()
fails to resolve the current WebServer
instance, an error is now thrown
instead of returning undefined
. This helps to identify "split brain" packaging issues, most commonly when using
npm link
or other developer tooling.@/platform-angular
: List peer dependency support for Angular 10, 11, 12, 13, and 14Changelog
🚀 3.0.0-rc.8
Changelog
🚀 3.0.0-rc.7
@/web-server
: WebServer#httpServer
is now public (read only)@/web-server
: Service classes can now receive an altOnListen(server : WebServer)
event, useful for configuring
aspects of the underlying Node.js http.Server instance directly.Changelog
🚀 3.0.0-rc.6
@alterior/platform-nodejs
now provides a global implementation of WebSocket
implementation using ws
if one is
not already availabledeepClone()
to handle cyclical object graphs correctly@SessionValue()
parameter decorator has been removed in preparation for the 3.0.0 release. This decorator was
deprecated in v3.0.0-beta.76
released on 2/27/2021. Use the Session
class instead.@QueryParams()
parameter decorator as a way to get a Record<string,string>
containing all query parameters
passed via URL. You can use a specific interface type for such parameters, but please note that Alterior does not
perform automatic coercion of the fields of the @QueryParmas()
object- all values will be strings.accessControl()
built-in middleware has been removed in preparation for the 3.0.0 release. This feature was
deprecated in v3.0.0-beta.2
released on 9/6/2018. Please use a Connect-compatible middleware package or create
your own instead. Feel free to start from Alterior's implementation, you can find it
at https://github.com/alterior-mvc/alterior/blob/c4e6730c98d7f2a6d20764612af0b7b2cd51c1e6/packages/web-server/src/accesscontrol.ts.@Request()
parameter decorator has been removed in preparation for the 3.0.0 release. This decorator was deprecated in v3.0.0-beta.76
released on 2/27/2021. Use WebEvent.request
instead to access parameters of the underlying HTTP request.RolesService#getRoleForModule()
method has been renamed to RolesService#getForModule()
RolesService#getById()
has been added.RolesService#start()
and RolesService#stop()
methods have been removed. Use RolesService#getById()
or
RolesService#getForModule()
and call start
/stop
on the resulting Role
object instead.Changelog
🚀 3.0.0-rc.5
@alterior/express
and @alterior/fastify
. As part of this,
you must now import @alterior/express
or @alterior/fastify
and specify it as the web server engine from this
version on. For example:
// main.ts
import { WebServerEngine } from '@alterior/web-server';
import { ExpressEngine } from '@alterior/express';
WebServerEngine.default = ExpressEngine;
Alternatively you can specify an engine via dependency injection:
@WebService({
providers: [
{ provide: WebServerEngine, useClass: ExpressEngine }
]
})
export class MyService {
// ...
}
This change reduces the complexity of Alterior's dependency tree by ensuring that excess web server dependencies
will not be present (ie fastify on an express app or express on a fastify app). It also fixes an issue where Alterior
users were required to install a lot of Express-related @types/*
packages to avoid Typescript errors during
development.@/annotations
@NgMetadataName()
and related Angular compatibility features have been entirely removed. They do not work with
newer versions of Angular. The recommended way to use Alterior with Angular is via @alterior/platform-angular
@/runtime
--self-test
option no longer starts the application (so the OnStart
lifecycle method does not execute)@/web-server
boolean
values on input parameters (ie @QueryParam()
) when a parameter annotated with boolean
type is used. The values ''
, 'no'
, '0'
, 'false'
, and 'off'
produce false
, all other values produce true
.Date
values on input parameters (ie @QueryParam
et al) when a parameter annotated with Date
type is used. Any string value that produces a valid Date
object via new Date(str)
will be accepted, otherwise a
400 Bad Request
will be returned without executing the route method. Caution: Because this accepts values in milliseconds (not seconds), it is not suitable for receiving UNIX timestamps.X-Trace
or so). Not enabled by
default. Use requestIdHeader
option when configuring the web server to enable this functionality.engine
option from WebServerOptions
. Either set WebServerEngine.default
or provide
WebServerEngine
as a dependency to specify the web engine. See above for details.@QueryParam()
no longer requires the name
parameter. Similar to the offer input decorators, @QueryParam()
already supported auto-detecting name
, this just adjusts the function signature to match the behavior.CertificateGenerator
is now properly exported for external use204 No Content
, provided the headers have not already
been sent, and the status code selected by the end of the request is 200 OK
. If you need to return an empty body
with status 200 OK
instead of 204 No Content
, call WebEvent.response.end()
before completing the request.