make config simpler

main
Mike Fix 6 years ago
parent 115ca7f7ff
commit f653d73ccd

@ -2,10 +2,11 @@ import axios from 'axios'
import debounce from 'lodash.debounce'
import ms from 'ms'
import getConfig from 'next/config'
const { publicRuntimeConfig } = getConfig()
const client = axios.create({ baseURL: publicRuntimeConfig.API_URL })
const client = axios.create({
baseURL: `${
process.env.API_URL || process.env.NODE_ENV === 'production' ? '' : 'http://localhost:4000'
}/api`
})
const RATE_LIMIT_CODE = 420

@ -1,8 +1,2 @@
// const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
// const withOffline = require('next-offline')
module.exports = {
publicRuntimeConfig: {
API_URL: process.env.API_URL || 'http://localhost:4000'
}
}

Loading…
Cancel
Save