@webstronauts/mercury
v0.10.0
Published
An opinionated framework built on top of Express.
Downloads
3
Readme
mercury ⚗️
An opinionated framework built on top of Express and avvio.
Installation
This package is distributed via NPM which is bundled with Node and should be installed as one of your project's dependencies
:
npm install --save @webstronauts/mercury
Usage
Your application can be as simple as:
// app.js
module.exports = function(app, options, next) {
app.get('/', function(req, res) {
res.send({hello: 'world'})
})
next()
}
If you are using Node 8+, you can use async
functions too:
// async-await-plugin.js
module.exports = async function(app, options) {
app.get('/', async function(req, res) {
res.send({hello: 'world'})
})
}
Then you can start your application with;
mercury start plugin.js
Inspiration
We're not re-inventing the wheel here. The inspiration for this framework comes from a couple of other awesome projects;
- https://github.com/mcollina/avvio
- https://github.com/fastify/fastify-cli
Author(s)
Robin van der Vleuten (@robinvdvleuten) - The Webstronauts