@morojs/moro


@morojs/moro / getApp

Function: getApp()

getApp(): Moro

Defined in: src/moro.ts:3535

Get the current Moro application instance.

Returns the app created by the most recent createApp() call. Use this in standalone route files so they can register routes without needing the app to be passed in.

Returns

Moro

Example

// routes/health.routes.ts
import { getApp } from '@morojs/moro';
const app = getApp();

app.get('/health', (req, res) => {
  res.json({ status: 'healthy' });
});