PHP Classes

File: front-produtos/js/components/FetchService.js

Recommend this page to a friend!
  Classes of Rodrigo Faustino   App MFE   front-produtos/js/components/FetchService.js   Download  
File: front-produtos/js/components/FetchService.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: App MFE
Single-page application with micro-frontends
Author: By
Last change:
Date: 1 month ago
Size: 374 bytes
 

Contents

Class file image Download
class FetchService { constructor(apiBaseUrl) { this.apiBaseUrl = apiBaseUrl; } async fetch(url, options = {}) { const response = await fetch(`${this.apiBaseUrl}${url}`, options); if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); } } export default FetchService;