mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* get client key on 429 error * set key to cookie and pass it in query params * move csrf-token header to useApiFetch * pin host for preview * actual layout * support new changes in API * proxy headers from API * add header to request * remove next.js proxy flag * fix ts * refactor * add tests
14 lines
467 B
TypeScript
14 lines
467 B
TypeScript
import appConfig from 'configs/app/config';
|
|
|
|
// FIXME
|
|
// I was not able to figure out how to send CORS with credentials from localhost
|
|
// unsuccessfully tried different ways, even custom local dev domain
|
|
// so for local development we have to use next.js api as proxy server
|
|
export default function isNeedProxy() {
|
|
if (appConfig.app.useNextJsProxy) {
|
|
return true;
|
|
}
|
|
|
|
return appConfig.app.host === 'localhost' && appConfig.app.host !== appConfig.api.host;
|
|
}
|