DEV Community

Cover image for A simple but powerful web framework for node.js-aex
NotFound404
NotFound404

Posted on

A simple but powerful web framework for node.js-aex

A framework prepared for web.

It supports

  1. object-oriented programming
  2. expressjs middlewares
  3. async/await
  4. Web Straight Line Theory
  5. decorators/annotations
  6. handy web processes like data parsing/filtering, error handling, websocket support

It separates business logic from web logic where MVC is none necessary.

It is simple but powerful.

The web straight line theory can be drawn like this:

Image description

A very simple example can be like this:

import { Aex, http } from "@aex/core";

class Helloworld {
  public message: string;
  constructor(message) {
    this.message = message;
  }
  @http("/")
  public async all(req: any, res: any) {
    res.end(this.message);
  }
}

const aex = new Aex();
aex.push(Helloworld, "Hello world!");
aex.prepare().start(8086);
Enter fullscreen mode Exit fullscreen mode

And when you visit the server, you will get the output message:

Hello world!
Enter fullscreen mode Exit fullscreen mode

You can check it here for more information.

Top comments (0)