https://github.com/cmmvio/cmmv-fastify
HTTP adapter module for using Fastify as an HTTP server
https://github.com/cmmvio/cmmv-fastify
adapter cmmv fastify http server
Last synced: about 1 year ago
JSON representation
HTTP adapter module for using Fastify as an HTTP server
- Host: GitHub
- URL: https://github.com/cmmvio/cmmv-fastify
- Owner: cmmvio
- License: mit
- Created: 2024-12-04T13:58:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-24T01:42:03.000Z (over 1 year ago)
- Last Synced: 2025-03-04T23:47:42.482Z (about 1 year ago)
- Topics: adapter, cmmv, fastify, http, server
- Language: TypeScript
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Contract-Model-Model-View (CMMV)
Building scalable and modular applications using contracts.
## 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:
```bash
$ pnpm add @cmmv/fastify @fastify/compress @fastify/cors @fastify/helmet @fastify/secure-session @fastify/static @fastify/view
```
## Quick Start
The `@cmmv/fastify` module provides an alternative HTTP adapter based on [Fastify](https://fastify.dev/), allowing you to use Fastify middleware and features seamlessly with your CMMV application.
```typescript
import { Application } from "@cmmv/core";
import { ViewModule } from "@cmmv/view";
import {
FastifyAdapter,
FastifyModule
} from "@cmmv/fastify";
Application.create({
httpAdapter: FastifyAdapter, // Add the FastifyAdapter here
wsAdapter: WSAdapter,
modules: [
FastifyModule, // Add the FastifyModule here
],
services: [...],
contracts: [...]
});
```