@Module

import { Module } from '@appt/core';

It is a class decorator responsible for call other modules and glue components together, creating the whole application's tree.

Every NodeJs application has one starter point. Using Appt, every starter point is an @Module and every group of components can be part of it.

An @Module has the following syntax and options:

import { Module } from '@appt/core';
‚Äč
@Module({
import: ['RoutersModule', 'ControllersModule'],
declare: ['DatabaseComponent', 'HelpersComponent']
})
export class AppMain {}

The example above, shows the class (AppMain) handled by our module decorator, which imports others modules and declares your components. It is important to notice that:

  • The import option is only used to call other modules;

  • The declare option is designed to assemble (and call) only components;