From c5e912cc5f6063a0bfda3b99ebaaf30f62f92714 Mon Sep 17 00:00:00 2001 From: romiogaku Date: Sat, 24 Feb 2018 22:21:14 +0900 Subject: [PATCH] .env --- .env.example | 1 + src/components/App.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1a9523f --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +REACT_APP_AIKATSUP_API_BASE_URL="http://localhost:29903/api/" diff --git a/src/components/App.js b/src/components/App.js index cbb1071..65048e4 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -5,7 +5,7 @@ import axios from "axios"; import Alert from "react-s-alert"; const instance = axios.create({ - baseURL: "http://localhost:29903/api/", + baseURL: process.env.REACT_APP_AIKATSUP_API_BASE_URL, timeout: 1000 }); @@ -18,6 +18,9 @@ class App extends React.Component { }; } handleSubmit(e) { + if (!this.state.word) { + return; + } instance .get("/v1/search", { params: {