You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jsonServerRequest.js 314B

12345678910111213
  1. import axios from 'axios';
  2. const JSON_SERVER_ENDPOINT = 'http://localhost:4000';
  3. const request = axios.create({
  4. baseURL: JSON_SERVER_ENDPOINT,
  5. headers: {
  6. 'Content-Type': 'application/json',
  7. },
  8. });
  9. export const getRequest = (url, params = null, options = null) =>
  10. request.get(url, { params, ...options });