Skip to content

Commit

Permalink
fix: axios problem
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Jan 17, 2022
1 parent 9b5900c commit 36fb949
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const withImages = require('next-images');
module.exports = {
...withImages(),
env: {
NEXT_PUBLIC_API_NEW: 'http://localhost:3006',
NEXT_PUBLIC_API_NEW: 'https://dev-k8s.treetracker.org/query',
NEXT_PUBLIC_TILE_SERVER_URL: 'https://{s}.treetracker.org/tiles/new/',
NEXT_PUBLIC_TILE_SERVER_SUBDOMAINS: 'dev-k8s',
},
Expand Down
6 changes: 3 additions & 3 deletions src/models/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import axios from 'axios';
import log from 'loglevel';

function parseDomain(url) {
Expand Down Expand Up @@ -54,8 +53,9 @@ async function requestAPI(url) {
log.warn('requestAPI:', urlFull);
// urlFull = urlFull.replace(/\?/, '/query/');

const res = await axios(urlFull);
return res.data;
const res = await fetch(urlFull);
const data = await res.json();
return data;
} catch (ex) {
log.error('ex:', ex);
throw new Error(ex.message);
Expand Down

0 comments on commit 36fb949

Please sign in to comment.