권주희

add API js for communication with server

...@@ -2636,6 +2636,37 @@ ...@@ -2636,6 +2636,37 @@
2636 "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", 2636 "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
2637 "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" 2637 "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug=="
2638 }, 2638 },
2639 + "axios": {
2640 + "version": "0.19.2",
2641 + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
2642 + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
2643 + "requires": {
2644 + "follow-redirects": "1.5.10"
2645 + },
2646 + "dependencies": {
2647 + "debug": {
2648 + "version": "3.1.0",
2649 + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
2650 + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
2651 + "requires": {
2652 + "ms": "2.0.0"
2653 + }
2654 + },
2655 + "follow-redirects": {
2656 + "version": "1.5.10",
2657 + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
2658 + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
2659 + "requires": {
2660 + "debug": "=3.1.0"
2661 + }
2662 + },
2663 + "ms": {
2664 + "version": "2.0.0",
2665 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
2666 + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
2667 + }
2668 + }
2669 + },
2639 "axobject-query": { 2670 "axobject-query": {
2640 "version": "2.1.2", 2671 "version": "2.1.2",
2641 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.2.tgz", 2672 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.2.tgz",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 "@testing-library/jest-dom": "^4.2.4", 6 "@testing-library/jest-dom": "^4.2.4",
7 "@testing-library/react": "^9.3.2", 7 "@testing-library/react": "^9.3.2",
8 "@testing-library/user-event": "^7.1.2", 8 "@testing-library/user-event": "^7.1.2",
9 + "axios": "^0.19.2",
9 "bootstrap": "^3.4.1", 10 "bootstrap": "^3.4.1",
10 "daum-map-api": "^1.0.2", 11 "daum-map-api": "^1.0.2",
11 "react": "^16.13.1", 12 "react": "^16.13.1",
......
1 +import axios from "axios";
2 +
3 +export default axios.create({
4 + baseURL: "http://localhost:3000",
5 + responseType: "json",
6 +});
...@@ -5,6 +5,7 @@ import Button from "react-bootstrap/Button"; ...@@ -5,6 +5,7 @@ import Button from "react-bootstrap/Button";
5 import "./home.css"; 5 import "./home.css";
6 import { Map, Marker, MarkerClusterer, Polyline } from "react-kakao-maps"; 6 import { Map, Marker, MarkerClusterer, Polyline } from "react-kakao-maps";
7 import "bootstrap/dist/css/bootstrap.min.css"; 7 import "bootstrap/dist/css/bootstrap.min.css";
8 +import API from "./API";
8 9
9 /* global kakao */ 10 /* global kakao */
10 11
......