Module

x/feathers/mod.ts>FeathersApplication

The API and real-time application framework
Go to Latest
interface FeathersApplication
import { type FeathersApplication } from "https://dotland.deno.dev/x/feathers@v5.0.0-pre.28/mod.ts";

Type Parameters

optional
ServiceTypes = any
optional
AppSettings = any

Properties

version: string

The Feathers application version

A list of callbacks that run when a new service is registered

services: ServiceTypes

The index of all services keyed by their path.

Important: Services should always be retrieved via app.service('name') not via app.services.

settings: AppSettings

The application settings that can be used via app.get and app.set

_isSetup: boolean

A private-ish indicator if app.setup() has been called already

Contains all registered application level hooks.

Methods

get<L extends keyof AppSettings & string>(name: L): AppSettings[L]

Retrieve an application setting by name

set<L extends keyof AppSettings & string>(name: L, value: AppSettings[L]): this

Set an application setting

configure(callback: (this: this, app: this) => void): this

Runs a callback configure function with the current application instance.

defaultService(location: string): ServiceInterface<any>

Returns a fallback service instance that will be registered when no service was found. Usually throws a NotFound error but also used to instantiate client side services.

use<L extends keyof ServiceTypes & string>(
path: L,
service: keyof any extends keyof ServiceTypes ? ServiceInterface<any> | Application : ServiceTypes[L],
options?: ServiceOptions,
): this

Register a new service or a sub-app. When passed another Feathers application, all its services will be re-registered with the path prefix.

service<L extends keyof ServiceTypes & string>(path: L): FeathersService<this, keyof any extends keyof ServiceTypes ? Service<any> : ServiceTypes[L]>

Get the Feathers service instance for a path. This will be the service originally registered with Feathers functionality like hooks and events added.

setup(server?: any): Promise<this>
hooks(map: HookOptions<this, any>): this

Register application level hooks.