-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-spa
Description
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('http://example.com'); // Relative URLs will be resolved against this
Metadata
Metadata
Assignees
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-spa