/**
* Cria um servidor `Express` com as rotas fornecidas.
*
* @param routes Um objeto `Router` que contém as rotas a serem adicionadas ao servidor.
* @returns Um objeto `Express` que representa o servidor criado.
*/
function createServer(routes: express.Router): express.Express;
Uso
/http/api.ts
import { HttpsOptions, onRequest } from 'firebase-functions/v2/https';
import { createServer } from '@burand/functions/http';
import routes from './routes.js';
const app = createServer(routes);
const options: HttpsOptions = {
cors: true,
maxInstances: 20,
region: 'southamerica-east1'
};
export const api = onRequest(options, app);