Agio

Agio

  • Docs
  • Get Started
  • CLI

Easily way to build APIs with NodeJS

Agio is a smaller framework to build HTTP APIs with NodeJS and Typescript. Connect to MongoDB and SQL databases, build controllers, services, validators and serve faster.

Get Started
@Injectable();
@Controller('dogs')
export class DogsController {

    constructor(private dogsService: DogsService) {}

    @Post('/', [DogsValidator])
    public async createDog(req: Request) {

        const await newDog = this.dogsService.create(req.body);
        req.sendResponse(newDog, HTTP_STATUS.CREATED);

    }

    @Get('/:id', [CacheMiddleware])
    public async getById(req: Request) {

        const dog = await this.dogsService.getById(req.params.id);
        req.sendResponse(dog, dog ? HTTP_STATUS.OK : HTTP_STATUS.NOT_FOUND);

    }

}
{
    "data": {
        "name": "R2 Dog 2",
        "breed": "robodog",
        "owner": {
            "name": "Anakin Skywalker"
        }
    },
    "code": 200,
    "metadata": {
        // ...
    }
}

Simplified routing

Agio uses Express to provide routing, but brings a simplified way to code routes with decorators that represent HTTP verbs and build the handlers.

Validators

Write efficient validation schemes using the javascript object and use them as middleware to validate any request. They will be validated with Joi.

Databases

Connect your application to MongoDB and many SQL databases. Agio supports multiple databases and uses Mongoose and Sequelize to create and connect models that can be injected using decorators.

Powered by community

Thank you very much to all open source projects that drive Agio

Agio
Docs
Getting Started
CLI
Install
More
GitHub
Facebook Open Source
Copyright © 2020 Agio