import React, { useState, useEffect } from "react";
import logo from './logo.svg';
import './App.css';

import _service from '@netuno/service-client';

function App() {
  const [data, setData] = useState([]);
  useEffect(() => {
    _service({
      url: "farmacias",
      success: (response) => {
      setData(response.json)
      },
      fail: (e) => {
          console.log("Service Error", e);
      }
  });

  }, []);
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.js</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
        {JSON.stringify(data)}
      </header>
    </div>
  );
}

export default App;
