1.1.0 • Published 6 years ago

@turinggroup/serverless-express-custom-domain-middleware v1.1.0

Weekly downloads
400
License
ISC
Repository
github
Last release
6 years ago

Serverless Express Custom Domain Middleware

install

npm install @turinggroup/serverless-express-custom-domain-middleware

usage

const customDomainReroute = require('@turinggroup/serverless-express-custom-domain-middleware').customDomainReroute;

app.use(customDomainReroute);

to call custom function when path is rerouted

const customDomainReroute = require('@turinggroup/serverless-express-custom-domain-middleware');
const rerouter = customDomainReroute.setup({
  onRouted: (originalPath, routedPath) => {
    // do something here
  }
});

app.use(rerouter);