Skip to Content
documentationCore Library@application

@application

The @application decorator marks the entry point of your aspectra-based application. It instantiates the class it decorates and calls its start method automatically.

Lack of start method will result in a compile-time error.

Example

import { application } from 'aspectra'
 
@application
class Application {
  public start() {
    console.log('Hello, world!')
  }
}
[auto-generated] output:
Hello, world!

This is functionally equivalent to:

const app = new Application()
app.start()

Running the Application

tsx src/index.ts
Last updated on