This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { redirect, type LoaderArgs } from "@remix-run/node"; | |
export async function removeTrailingSlashes(request: Request) { | |
let url = new URL(request.url); | |
if (url.pathname.endsWith("/") && url.pathname !== "/") { | |
throw redirect(url.pathname.slice(0, -1) + url.search); | |
} | |
} | |
export async function loader({ request }: LoaderArgs) { |