This framework is built on-top of Express and is intended to provide a standard to help the design, development, and life-cycle management of scalable and efficient server-side web application (with Node.js). It can also be used to invert the control in a pre-existent Express application.
npm i peque.ts
The usage of the Node.js LTS version is required.
import { TestRootModule } from './modules/root/test-root.module';
import { ExpressFactory } from 'peque.ts';
import * as bodyParser from 'body-parser';
import * as cors from 'cors';
async function startUp() {
await ExpressFactory.createServer({
rootModule: TestRootModule,
globalMiddlewares: {
preRoutes: [
bodyParser.urlencoded({ extended: true }),
bodyParser.json({ limit: '2m' })
],
postRoutes: [cors]
},
swagger: {
folder: '/doc',
info: {
title: 'Test API',
description: 'Test API description',
contacts: {
name: 'Simone Di Cicco',
email: '[email protected]'
},
version: '1.0.0'
},
servers: [{ url: 'https://api.test.com/'}],
tags: [
{
name: 'Tag',
description: 'Description'
}
]
},
isCpuClustered: false
}
);
}
startUp();