JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q30648F
  • License MIT

HTTP adapter module for using Express as an HTTP server

Package Exports

  • @cmmv/express

Readme

CMMV Logo

Contract-Model-Model-View (CMMV)
Building scalable and modular applications using contracts.

NPM Version Package License

DocumentationReport Issue

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: [...]
});