Redirect Activity Streams 2.0

Middleware to create redirections to any AS2 bridge

Options

Description

This middleware redirects all Activity Stream requests to any server like Hatsu or Bridgy Fed.

Installation

This middeware must be used with the Lume's HTTP Server. To use it in production, you need a host running a Deno server, like Deno Deploy.

You have to provide the rewriteUrl option with a function that return the URL for the redirection. The middleware has two helpers: bridgyFed and hatsu.

Create an entry point file (for example, serve.ts) with the following code:

import Server from "lume/core/server.ts";
import redirectAS2, { bridgyFed } from "lume/middlewares/redirect_as2.ts";

const server = new Server();

const rewriteUrl = bridgyFed();

server.use(redirectAS2({ rewriteUrl }));

server.start();