ExpressJS
FoalTS applications are created with the createApp
function in the src/index.ts
file. This function takes the root controller class (known as AppController
) as parameter.
import { createApp } from '@foal/core';
const app = await createApp(AppController);
The returned value is an ExpressJS application that can be used as is to create an HTTP server. FoalTS is not designed to integrate Express middlewares in its controllers or hooks. However, if for any reason you need to apply globally a middleware to the application, you have two ways to do it.