one
Version:
One is a new React Framework that makes Vite serve both native and web.
13 lines (12 loc) • 422 B
JavaScript
import { getURL } from "../getURL.native.js";
import { router } from "../router/imperative-api.native.js";
var redirect = function (path, status) {
if (process.env.VITE_ENVIRONMENT === "client") {
router.navigate(path);
return;
}
var finalPath = path[0] === "/" ? `${getURL()}${path}` : path;
return Response.redirect(finalPath, status);
};
export { redirect };
//# sourceMappingURL=redirect.native.js.map