Clean up development process
This commit is contained in:
parent
1d6c07a223
commit
07cd6704fc
5 changed files with 17 additions and 1 deletions
3
.env.development
Normal file
3
.env.development
Normal file
|
@ -0,0 +1,3 @@
|
|||
REACT_APP_API_PROTO=http://
|
||||
REACT_APP_API_DOMAIN=sudosci.test:8080
|
||||
REACT_APP_API_PATH=/v1/api/
|
3
.env.production
Normal file
3
.env.production
Normal file
|
@ -0,0 +1,3 @@
|
|||
REACT_APP_API_PROTO=https://
|
||||
REACT_APP_API_DOMAIN=api.sudoscientist.com
|
||||
REACT_APP_API_PATH=/v1/api/
|
|
@ -8,5 +8,6 @@ This project was started using create-react-app
|
|||
|
||||
```
|
||||
npm install
|
||||
update .env files
|
||||
npm start
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export default axios.create({
|
||||
baseURL: 'https://api.sudoscientist.com/v1/api/',
|
||||
baseURL: process.env.REACT_APP_API_PROTO + process.env.REACT_APP_API_DOMAIN + process.env.REACT_APP_API_PATH,
|
||||
withCredentials: true
|
||||
});
|
||||
|
|
|
@ -202,6 +202,15 @@ class AuthMenu extends Component {
|
|||
<i className="edit icon"></i>
|
||||
<button onClick={() => { document.location.href = "/newpost/"; }} className="fluid ui positive button">Create Post!</button>
|
||||
</div>
|
||||
<div className="ui left icon input">
|
||||
<i className="sign-out icon"></i>
|
||||
<button onClick={() => {
|
||||
var cookies = new Cookies();
|
||||
cookies.remove('DataCookie', { path: '/', domain: process.env.REACT_APP_API_DOMAIN });
|
||||
window.location.reload();
|
||||
}} className="fluid ui negative button">Sign Out</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
default:
|
||||
|
|
Reference in a new issue