Skip to content

Commit

Permalink
Move api url definition into .env
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Meredith committed Nov 7, 2023
1 parent 5a02bbf commit acdc1d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions azlibrary_react/src/components/container/AzgsApi.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from "axios";

const api = axios.create({
// Only place the API base-url is set
baseURL: "https://data.azgs.arizona.edu/api/v1",
baseURL: process.env.REACT_APP_AZLIB_API_URL,
});

export default api;
2 changes: 1 addition & 1 deletion azlibrary_react/src/components/presentation/Files.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Files({ files, collectionID }) {
<div className="font-weight-bold">{key}</div>
<ul>
{/* Files */}
{value.map(file => <li key={file}><a target="_blank" href={`https://data.azgs.arizona.edu/api/v1/collections/${collectionID}/${file}`}>{file}</a></li>)}
{value.map(file => <li key={file}><a target="_blank" href={`${process.env.REACT_APP_AZLIB_API_URL}/collections/${collectionID}/${file}`}>{file}</a></li>)}
</ul>
</div>
)
Expand Down

0 comments on commit acdc1d3

Please sign in to comment.