1.0.0-alpha.77 • Published 4 years ago
@dandi/http v1.0.0-alpha.77
@dandi
Dandi is a modular DI and MVC application framework designed to make it easier to write RESTful APIs, console applications, and other services for NodeJS with TypeScript. It is split into modules to allow developers to use only the features they require.
Use Cases
- MVC-style Application Servers
- CLI Applications
- AWS Lambda functions
Features
Dependency Injection
- Modeled after Angular's dependency injection system
- Inject dependencies into class constructors or methods
- 3rd party dependencies can be configured to be injected with Providers
HTTP Pipeline
- Standalone pipeline for handling and responding to HTTP requests
- Automatic input content negotiation based on request
content-typeheader - Automatic output content negotiation based on request
acceptheader - Create and configure interdependent middleware handlers (
HttpPipelinePreparer) and they will automatically be invoked in the correct order - Add global transformers to control response data structure
MVC
- Modeled after ASP.NET Core MVC
- Builds on functionality of
@dandi/http-pipelineto add routing and other MVC features - Web framework agnostic - Built for Express 4, but can be used with other frameworks if desired
- Decorator-based route configuration
- Automatic path parameter, query parameter, and body model mapping and validation
- Support for automatically generating HA JSON output
Model Building and Validation
- Robust set of decorators for defining models and validation metadata
- Automatically construct model class instances from JSON objects or POJOs
- Convert from objects using a different property key casing
(e.g.
snake_casetocamelCase)
AWS Lambda
- Wraps
@dandi/http-pipelinefor use with handline AWS Lambda requests - Use the same framework, models, and add-ons (
HttpPipelinePreparer,HttpPipelineResultTransformer) between your Lambda functions and MVC API
Misc
Disposableinterface and utilities for managing disposable resources- Uses Luxon as a replacement for Date objects
- Models can be reused between backend NodeJS and frontend TypeScript/JavaScript applications
Uuidclass based on the uuid library for working with and comparing UUIDs.
Core Modules
- @dandi/cache - Caching functionality
- @dandi/common 🕸 - Common types and utilities
- @dandi/config 🕸 - Configuration services
- @dandi/core 🕸 - Dependency Injection
- @dandi/core/logging 🕸 - Core logging and configuration
- @dandi/core-node - Additional DI utilities specific to NodeJS
- @dandi/data 🕸 - Base types and utilities for working with data services
- @dandi/hal - 🕸 - Model decorators, basic types and utilities for supporting HAL
- @dandi/hal-model-builder - 🕸 - Model building utilities supporting HAL embedded resources
- @dandi/http - Types, utilities and DI tokens for basic HTTP concepts (headers, mime types, etc)
- @dandi/http-model - Types, decorators, and utilities for using model building and validation in an HTTP context
- @dandi/http-pipeline - A pipeline for handling and responding to HTTP requests
- @dandi/logging - 🕸 - Additional utilities for logging and logging configuration
- @dandi/model 🕸 - Decorators for describing models, for use with
@dandi/model-builder - @dandi/model-builder 🕸 - Utilities for dynamically constructing and validating models
- @dandi/mvc - MVC decorators and base utilities (not specific to Express)
- @dandi/mvc-hal - Supports rendering HAL JSON from existing
@dandi/mvccontrollers - @dandi/mvc-view - Use
@dandi/mvcwith your favorite templating engine
3rd Party Integration Modules
- @dandi-contrib/aws-lambda Helpers for using
@dandi/coreand@dandi/http-pipelinewith AWS Lambda - @dandi-contrib/config-aws-ssm -
@dandi/configclient for AWS SSM Parameter Store - @dandi-contrib/data-pg -
@dandi/dataclient implementations for Postgres - @dandi-contrib/mvc-auth-firebase - Google Firebase Authorization service implementation for
@dandi/mvc - @dandi-contrib/mvc-express - Express-specific
@dandi/mvcservice implementations - @dandi-contrib/mvc-view-ejs - EJS implementation for
@dandi/mvc-view - @dandi-contrib/mvc-view-pug - Pug implementation for
@dandi/mvc-view
🕸 - web browser compatible/no NodeJS-specific dependencies
Examples
Simple Express REST API - An
implementation of a very simple REST API using @dandi
1.0.0-alpha.76
4 years ago
1.0.0-alpha.77
4 years ago
1.0.0-alpha.74
4 years ago
1.0.0-alpha.73
4 years ago
1.0.0-alpha.75
4 years ago
1.0.0-alpha.72
4 years ago
1.0.0-alpha.71
5 years ago
1.0.0-alpha.70
5 years ago
1.0.0-alpha.69
5 years ago
1.0.0-alpha.67
5 years ago
1.0.0-alpha.68
5 years ago
1.0.0-alpha.66
5 years ago
1.0.0-alpha.65
5 years ago
1.0.0-alpha.63
5 years ago
1.0.0-alpha.64
5 years ago
1.0.0-alpha.62
5 years ago
1.0.0-alpha.61
5 years ago
1.0.0-alpha.60
5 years ago
1.0.0-alpha.59
5 years ago
1.0.0-alpha.56
5 years ago
1.0.0-alpha.58
5 years ago
1.0.0-alpha.57
5 years ago
1.0.0-alpha.55
6 years ago
1.0.0-alpha.54
6 years ago
1.0.0-alpha.53
6 years ago
1.0.0-alpha.52
6 years ago