Skip to main content
This release is 17 versions behind 1.4.6 — the latest version of @fedify/fedify. Jump to latest

Built and signed on GitHub Actions

An ActivityPub/fediverse server framework

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
94%
Published
3 months ago (1.3.3)
class Router

URL router and constructor based on URI Template (RFC 6570).

Constructors

new
Router(options?: RouterOptions)

Create a new Router.

Methods

add(
template: string,
name: string,
): Set<string>

Adds a new path rule to the router.

build(
name: string,
values: Record<string, string>,
): string | null

Constructs a URL/path from a path name and values.

Checks if a path name exists in the router.

Resolves a path name and values from a URL, if any match.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import { Router } from "@fedify/fedify/federation";

---- OR ----

Import directly with a jsr specifier

import { Router } from "jsr:@fedify/fedify/federation";

Add Package

npx jsr add @fedify/fedify

Import symbol

import { Router } from "@fedify/fedify/federation";

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

import { Router } from "@fedify/fedify/federation";

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

import { Router } from "@fedify/fedify/federation";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import { Router } from "@fedify/fedify/federation";