Releases: malijs/mali
Releases · malijs/mali
0.9.0
Changes
- Throw when we fail to bind on a port when already taken
- Update dependencies
All changes: 0.8.2...0.9.0
0.7.1
0.7.0
Changes
- Add support for explicitly setting response to an Error and sending it to client.
Example:
async function hello (ctx) {
ctx.res = new Error('boom!')
}
This will send the error to the client but circumvent application error logging regardless of app.silent
setting.
All changes: 0.6.1...0.7.0
0.6.1
0.6.0
Changes
Change grpc
to be a peer dependency
- Application
package.json
will have to includegrpc
as a dependency along withmali
. This way clients can controlgrpc
version.
Add support for multi proto servers
- Added support for creating a Mali app instance from multiple protocol buffer definitions
- Renamed
init()
toaddService()
. This is not the same asgrpc.server.addService()
Example:
helloworld.proto
syntax = "proto3";
package helloworld;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
argservice.proto
syntax = "proto3";
package argservice;
service ArgService {
rpc DoSomething (ArgRequest) returns (ArgReply) {}
}
message ArgRequest {
string message = 1;
}
message ArgReply {
string message = 1;
}
const proto1 = path.resolve(__dirname, './protos/helloworld.proto')
const proto2 = path.resolve(__dirname, './protos/argservice.proto')
function sayHello (ctx) {
ctx.res = { message: 'Hello ' + ctx.req.name }
}
function doSomething (ctx) {
ctx.res = { message: ctx.req.message.toUppercase() }
}
const app = new Mali()
app.addService(proto1)
app.addService(proto2)
app.use({ sayHello })
app.use({ doSomething })
app.start()
All changes: 0.5.0...0.6.0
0.5.0
0.4.1
0.4.0
Changes
- Add Request and Response to Context and support for metadata (#15):
- Add
Request
class andrequest
object to context - Add
Response
class andresponse
object to context - Delegate most properties and functions from context to request and response
- Add metadata properties and functions to request and response
- Changes are backwards compatible
- Update dependencies
All changes: 0.3.3...0.4.0
0.2.4
0.2.3
Changes
- Added the following to properties to
context
:{String} fullName
- the full name of the call. ex'/helloworld.Greeter/SayHello'
{String} service
- the service name of the call. ex'Greeter
{String} package
- the package name of the call. ex'helloworld
- Various minor improvements
All changes: 0.2.2...0.2.3