Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.75 KB

Progressive-Development.md

File metadata and controls

70 lines (48 loc) · 1.75 KB

npm version standard-readme compliant

augejs is a progressive Node.js framework for building applications.

🌟 Star us on GitHub — it helps! 👏

https://github.com/augejs/augejs.github.io

Progressive Development

augejs application has the design philosophy of Composition over inheritance. The augejs core layer is small and simple. It supports the Module, Provider, Decorator to Composite the application.

Webserver(Koa) Application

import { Module, boot } from '@augejs/core';
import { WebServer } from '@augejs/koa';

@WebServer()
@Module()
class AppModule {
  @RequestMapping.Get('ping')
  ping() {
    return 'pong';
  }
}

(async () => {
  await boot(AppModule);
})();

https://github.com/augejs/examples/tree/master/packages/koa

Spider Application

import { Module, ILogger, Inject, boot, GetLogger } from '@augejs/core';
import { AXIOS_IDENTIFIER, AxiosConfig, AxiosInstance } from '@augejs/axios';

@Module()
@AxiosConfig()
class AppModule {

  @Inject(AXIOS_IDENTIFIER)
  httpService!: AxiosInstance;

  @GetLogger()
  logger!: ILogger;

  async onInit() {
    this.logger.info('app on onInit');

    const results = await this.httpService.get('http://www.baidu.com');
    this.logger.info(results.data);
  }
}

async function main() {
  await boot(AppModule);
}

main();

https://github.com/augejs/examples/tree/master/packages/axios