feathers()
Creates a new Feathers application instance.object
Type definition for all services registered on the application
object
Type definition for application settings
Application<Services, Settings>
A new Feathers application instance
Properties
version
services
settings
app.get() and app.set().
mixins
Methods
get()
Retrieve an application setting by name.string
required
The setting name
any
The setting value, or
undefined if not setset()
Set an application setting.string
required
The setting name
any
required
The setting value
Application
The application instance for chaining
configure()
Runs a callback configure function with the current application instance.function
required
The callback
(app: Application) => void to run. The callback is called with this bound to the app instance.Application
The application instance for chaining
use()
Register a new service or a sub-app. When passed another Feathers application, all its services will be re-registered with thepath prefix.
string
required
The path for the service to register (e.g.,
'/users', '/api')ServiceInterface | Application
required
The service object to register or another Feathers application to use as a sub-app
ServiceOptions
Configuration options for this service
string[]
A list of service methods that should be available externally to clients
string[]
A list of custom events that this service emits to clients
string[]
Provide a full list of events that this service should emit. Unlike
events, this will not be merged with the default events.Application
The application instance for chaining
service()
Get the Feathers service instance for a path. This will be the service originally registered with Feathers functionality like hooks and events added.string
required
The name of the service (e.g.,
'users', '/api/messages')FeathersService
The service instance with hooks and events
unuse()
Unregister an existing service. Callsteardown on the service if it exists.
string
required
The name of the service to unregister
Promise<FeathersService>
The unregistered service instance
setup()
Set up the application and call all services’.setup() method if available.
any
A server instance (e.g., HTTP server)
Promise<Application>
The application instance
teardown()
Tear down the application and call all services’.teardown() method if available.
any
A server instance (e.g., HTTP server)
Promise<Application>
The application instance
hooks()
Register application-level hooks that run for all services.ApplicationHookOptions
required
The application hook settings
Application
The application instance for chaining
defaultService()
Returns a fallback service instance that will be registered when no service was found. Usually throws aNotFound error but also used to instantiate client-side services.
string
required
The path of the service
ServiceInterface
A fallback service instance
Events
The Feathers application extends Node’sEventEmitter, so you can use all EventEmitter methods: