import axios from "axios";

const api = axios.create({
  baseURL: "https://fakestoreapi.com",
  timeout: 10000
});

export async function fetchProducts() {
  const response = await api.get("/products");
  return response.data;
}

export async function fetchProductById(id) {
  const response = await api.get(`/products/${id}`);
  return response.data;
}
