Simple redirect middleware

Since
  • 1.0.0
Author
  • Glenn de Haan

Example

const {Runtime, Server} = require('@neobeach/core');
const redirect = require('@neobeach/middlewares-redirect');

const server = new Server();

Runtime(() => {
   server.loadMiddlewares([redirect({static: {'/test': '/test1'}, regex: {'^/test123/.*': '/new'}})]);
   server.run();
});

Members

(inner, constant) valid_status_options

Define statics