Server Utilities

Utilities available from neutron. These should generally only be used in loader and action functions.

redirect

Throws a redirect response.

import { redirect } from "neutron";

export async function action() {
  throw redirect("/login");
}

Response Helpers

Neutron uses standard Response objects. You can construct them directly.

export async function loader() {
  if (!found) {
    throw new Response("Not Found", { status: 404 });
  }
}