-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preload only working on localhost #93
Comments
Hey! Pls, help me. What is your So, I have this structure: {
"@context" : "/api/contexts/Environment",
"@id" : "/api/environments",
"@type" : "hydra:Collection",
"hydra:member" : [
{
"@id" : "/api/environments/1",
"@type" : "Environment",
"id" : 1,
"uuid" : "020e8181-6362-485d-bbc5-2714d9d8d19b",
"name" : "inventore",
"cpu" : 8000,
"memory" : 8192,
"storage" : 100000,
"project" : "/api/projects/2",
"provider" : "/api/providers/1",
"envVar" : [],
"state" : "/api/states/9",
"environmentComponent" : [],
"region" : "/api/regions/1",
"exportedData" : []
},
],
"hydra:totalItems" : 15,
... and so on I would like to get the project through push request, so I send the And I know, the normalization context is not restricted to iri-only:
But I have correct caddy config:
The code: const fetchJson = async (url, opts = {}) => {
const resp = await fetch(url, {
headers: {
Authorization: `Bearer ${window.localStorage.getItem('auth')}`,
...opts,
}
});
return resp.json();
};
const preload = "/hydra:member/*/@id/project";
const req = await fetchJson(
`/api/environments?preload=${preload}`,
{ Preload: preload, }
);
for (const envItem of req[ 'hydra:member' ]) {
const env = await fetchJson(envItem[ '@id' ]);
const project = await fetchJson(`/api/projects${getId(env.project, '/api/projects')}`);
console.log(
project
);
} These are not working as Preload path:
Extra questionDo you know, how to add multiple preload queries? So, what if I want to get
I think it needs a little more docs. 😆 |
When making API calls from
http://localhost:19006
push seems to be working fine and it loads 400 requests in a few seconds however when I try via192.168.1.181:19006
or on my iOS app making fetch requests it seems to be failing and loading them normally which takes over 30s.I'm using the API Platform Docker for the backend. Any help would be appreciated
The text was updated successfully, but these errors were encountered: