Home Manual Reference Source Test Repository

References

References

Class Summary

Static Public Class Summary
public

Represents an application providing functionalities specific to Web requests.

public

Represents an error caused by an improper request of the end-user.

Function Summary

Static Public Function Summary
public

Gets the instance of the currently running application.

public

createObject(type: string | object, params: ...*): *

Creates a new object using the dependency injection (DI) container of the application.

public

async errorAction(ctx: Context, next: function)

Manages the application errors.

public

Creates a middleware function managing the application errors.

public

getAlias(alias: string, throwError: boolean): string

Translates a path alias into an actual path.

public

registerType(alias: string): *

Registers a type in the dependency injection (DI) container of the application.

public

Creates a middleware function setting some security-related headers.

public

setAlias(name: string, path: string)

Registers a path alias.

public

statusAction(ctx: Context)

Sends the application status.

public

Creates a middleware function sending the application status.

Changelog

Changelog

This file contains highlights of what changes on each version of the Core library for Koa package.

Version 0.2.0

  • Breaking change: removed the Application#components property.
  • Breaking change: removed the notFoundHandler middleware.
  • Added the @core alias representing the directory where the core library is located.
  • Added the forceSSL, mailer and publicPath properties to the Application class.
  • Added the close() and listen() methods to the Application class.
  • Added the get(), has(), remove() and set() methods to the Application class.
  • Added the HTTPError class.
  • Added the createObject() and registerType() functions.
  • Added the throwError parameter to the getAlias() function.
  • Added the securityHandler middleware.
  • Added support for application components.
  • Added preliminary support for mailing.
  • Added a build task for spawning a development server and watching file changes.
  • Added more unit tests.
  • Documented more features.

Version 0.1.0

  • Initial release.