I tried to run such code on server-side but for some reason it doesn't work. fetch function is imported from domain-task
return fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(response => response.json())
.then(response => {
return fetch('https://jsonplaceholder.typicode.com/posts/2')
.then(response2 => response2.json())
});
I receive the following error:
Exception: Call to Node module failed with error: Error:
When running outside the browser (e.g., in Node.js), you must specify a base URL
before invoking domain-task's 'fetch' wrapper.
Example:
import { baseUrl } from 'domain-task/fetch';
baseurl('/api/public/proxy/example.com/'); // Relative URLs will be resolved against this
I tried to run such code on server-side but for some reason it doesn't work.
fetchfunction is imported fromdomain-taskI receive the following error: