Skip to Content
Senri

Trailing slash

Normalize trailing slashes with trailingSlash()

import { ,  } from "@senrijs/senri";

const  = ();

.(());   // 301 from /a/ to /a
  • /a and /a/ already match the same route (Path rules). Use this to keep one URL form (for SEO)
  • It redirects only GET and HEAD, and only paths that matched a route

Options

Prop

Type

On this page