Releases: xpresserjs/framework
Releases · xpresserjs/framework
Added LICENSE and updated Packages
Added an MIT LICENSE file.
Updated 'fs-extra`
Updated Packages & Changed how empty string values in body is converted to null
- Using
sync
middleware function instead ofasync
when converting empty string body values tonull
- Updated Typescript
- Updated Moment
- Updated Moment Timezone
Add http.onError function to handle all errors
if using a custom RequestEngine.ts
you can define a method called onError()
to handle all thrown errors in any http request.
See How To Extend Request Engine
class MyRequestEngine extends $.extendedRequestEngine() {
onError(error, formattedError){
// Respond how ever you wish
this.send({message: error.message. formattedError});
}
}
Xpresser checks if this function exists and then calls it.
Added types of `fs` and `fsExtra` in fileEngine
Added types of fs
and fsExtra
in fileEngine. Thanks to @techieoriname
Also updated packages.
No Breaking Change
Added Detailed Logger
The request logger has been refactored to display more (optional) data.
See: debug.requests config.
Upgraded Object-collection
Updated Xpresser to version 0.26.0
This version includes minor Typescript Related breaking changes regarding the new typed object-collection
Since object-collection is widely used in xpresser you may now need to declare types when accessing object-collection instances.
For example
// This may throw a type error
const name = http.$body.get("name");
// Proper way.
const name: string = http.$body.get("name");
// OR
// Proper way.
const name = http.$body.get<string>("name");