mercredi 10 novembre 2021

Making a API Request in ember js

I am trying to learn ember JS, and I want to make a API request watched and read soo many videos and blogs also not clear enough how to call a API and store that data in the official docs.

const response = await fetch('/api/users.json');
const {data} = await response.json();
console.log(data)

This is what I tried ,but there is nothing in console I have created a folder in public directory and created a folder called API in it and saved my user.json file in it. My directory path

Hope, someone can explain how to make a API request in ember, if u can refer some blog or tutorial also will help me. Thanks in advance




Aucun commentaire:

Enregistrer un commentaire