chore: move all services inside the apps folder (#7321)

* chore: move all services inside the apps folder

* chore: rename apiserver to server
This commit is contained in:
sriram veeraghanta 2025-07-03 00:44:13 +05:30 committed by GitHub
parent 6000639921
commit 944b873184
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3442 changed files with 1 additions and 4 deletions

View file

@ -0,0 +1,28 @@
"use client";
import { useEffect } from "react";
import ReactDOM from "react-dom";
// https://nextjs.org/docs/app/api-reference/functions/generate-metadata#link-relpreload
export const usePreloadResources = () => {
useEffect(() => {
const preloadItem = (url: string) => {
ReactDOM.preload(url, { as: "fetch", crossOrigin: "use-credentials" });
};
const urls = [
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/instances/`,
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/users/me/`,
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/users/me/profile/`,
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/users/me/settings/`,
`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/users/me/workspaces/?v=${Date.now()}`,
];
urls.forEach(url => preloadItem(url));
}, []);
};
export const PreloadResources = () => {
usePreloadResources();
return null;
};