@cmmv/express
v0.6.17
Published
HTTP adapter module for using Express as an HTTP server
Downloads
369
Readme
Description
CMMV (Contract-Model-Model-View) is a minimalistic and modular framework for building scalable applications in TypeScript. Inspired by modern design patterns, CMMV uses contracts to define the entire application, from ORM entities to REST controllers and WebSocket endpoints, allowing for a highly structured and maintainable codebase.
Legacy Setup (Manual)
If you prefer to set up the project manually, you can still install the necessary modules individually:
$ pnpm add @cmmv/express express body-parser cors express-session helmet uuid
Quick Start
The @cmmv/express
module provides an alternative HTTP adapter based on Express, allowing you to use Express middleware and features seamlessly with your CMMV application.
import { Application } from "@cmmv/core";
import { ExpressAdapter, ExpressModule } from "@cmmv/express";
import { ViewModule } from "@cmmv/view";
Application.create({
httpAdapter: ExpressAdapter, // Add the ExpressAdapter here
wsAdapter: WSAdapter,
modules: [
ExpressModule, // Add the ExpressModule here
],
services: [...],
contracts: [...]
});