UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

13 lines (12 loc) 402 B
import { getURL } from "../getURL.mjs"; import { router } from "../router/imperative-api.mjs"; const redirect = (path, status) => { if (process.env.VITE_ENVIRONMENT === "client") { router.navigate(path); return; } const finalPath = path[0] === "/" ? `${getURL()}${path}` : path; return Response.redirect(finalPath, status); }; export { redirect }; //# sourceMappingURL=redirect.mjs.map