express-route-easy

Express route easy

Usage no npm install needed!

<script type="module">
  import expressRouteEasy from 'https://cdn.skypack.dev/express-route-easy';
</script>

README

express-route-easy

Install

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm i express-route-easy

Examples

Using with

Using with express

const express = require('express')
const app = express()

const easy = require('express-route-easy')

exports.import = ['/import', async (req, res, next) => {
  res.send({go: 'the force awakens'})
}]

exports.export = ['/export', async (req, res, next) => {
  res.send({go2: 'the force awakens'})
}]

exports.routes = easy([], exports)

app.use('/v1', exports.routes)

License

MIT