DEV Community 👩‍💻👨‍💻

Cover image for The express.js alternative web framework for 2022: aex
NotFound404
NotFound404

Posted on

The express.js alternative web framework for 2022: aex

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.

https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8s1vipj6joac1fgiu87.png

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);
Enter fullscreen mode Exit fullscreen mode

for detailed info please visit: https://github.com/calidion/aex

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.