Medley
Medley is a fast and modern web framework for Node.js. It fully supports both async
/await
and
callbacks and is compatible with Node 6 or greater. It's design incorporates concepts found in
Express, Koa,
hapi, and Fastify.
Most importantly, Medley aims to provide an API that is forward-compatible with future versions
that will take full advantage of Node's HTTP/2
module.
Usage
Install:
npm install @medley/medley --save
Create a web server:
const medley = require('@medley/medley')
const app = medley()
app.get('/', (req, res) => {
res.send('Hello World')
})
app.listen(3000)
Documentation
Features
- An API similar to Express
- Performance on par with Fastify
- Full support for both
async
/await
and callbacks - Automatic
HEAD
, OPTIONS
, and 405
responses - Facilities for safely extending the framework (extensions)
- 100% test coverage
- HTTP/2 support
Forward-Compatibility with the http2
Module
HTTP/2 is the future of the web. It is faster than HTTP/1.x and comes with new, speed-boosting
features such as server push.
The Node.js http2
module has a very different API from the http
/https
modules, but it also provides a
compatibility API. Medley currently
uses the compatibility API (to support both HTTP/1.x and HTTP/2), but Medley's API is designed such
that when Medley upgrades to the full http2
API, application code built on Medley should not need
to change. Medley's goal is to insulate application code from this transition (as much as possible)
so that code written now that won't require massive rewrites in the future.
Ecosystem
Body Parsing
Plugins
Validation
Acknowledgements
This project was forked from Fastify. The initial commit is a clone of fastify/fastify@dab20bd
. All of the credit for that work goes to the Fastify team.