express.js hasn't been updated for years.
For the time expressjs was created, javascript has no concepts like Promise and async/await to ease the way to write async invocations with functions. This can easily cause callback holes.
Over time when javascript introduced Promise and async/await, we can very easily write sync code with async/await to invoke async functions.
To write clean code with async calls, aex was created from scatch.
It is compaitiable with most expressjs middlewares, and have better support for async calls.
It also provides better way to organise your project with classes/files. And ease the way you handle http requests with a class.
This is a very simple example on how aex works:
import { Aex, http } from "@aex/core";
class Helloworld {
public message: string;
constructor() {
this.message = "Hello world!";
}
@http("/")
public async all(req: any, res: any) {
res.end(this.message);
}
}
const aex = new Aex();
aex.push(Helloworld);
// aex.prepare().start(8086).then();
await aex.prepare().start(8086);
for detailed info please visit: https://github.com/calidion/aex
Top comments (0)