Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
e6dbb39b
Commit
e6dbb39b
authored
May 09, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unpin api host
parent
f8f97421
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
config.ts
configs/app/config.ts
+1
-2
isNeedProxy.ts
lib/api/isNeedProxy.ts
+2
-3
No files found.
configs/app/config.ts
View file @
e6dbb39b
...
@@ -35,8 +35,7 @@ const baseUrl = [
...
@@ -35,8 +35,7 @@ const baseUrl = [
appPort
&&
'
:
'
+
appPort
,
appPort
&&
'
:
'
+
appPort
,
].
filter
(
Boolean
).
join
(
''
);
].
filter
(
Boolean
).
join
(
''
);
const
authUrl
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AUTH_URL
)
||
baseUrl
;
const
authUrl
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_AUTH_URL
)
||
baseUrl
;
// const apiHost = getEnvValue(process.env.NEXT_PUBLIC_API_HOST);
const
apiHost
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_HOST
);
const
apiHost
=
'
eth-goerli.blockscout.com
'
;
const
apiSchema
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_PROTOCOL
)
||
'
https
'
;
const
apiSchema
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_PROTOCOL
)
||
'
https
'
;
const
apiPort
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_PORT
);
const
apiPort
=
getEnvValue
(
process
.
env
.
NEXT_PUBLIC_API_PORT
);
const
apiEndpoint
=
apiHost
?
[
const
apiEndpoint
=
apiHost
?
[
...
...
lib/api/isNeedProxy.ts
View file @
e6dbb39b
//
import appConfig from 'configs/app/config';
import
appConfig
from
'
configs/app/config
'
;
// FIXME
// FIXME
// I was not able to figure out how to send CORS with credentials from localhost
// I was not able to figure out how to send CORS with credentials from localhost
// unsuccessfully tried different ways, even custom local dev domain
// unsuccessfully tried different ways, even custom local dev domain
// so for local development we have to use next.js api as proxy server
// so for local development we have to use next.js api as proxy server
export
default
function
isNeedProxy
()
{
export
default
function
isNeedProxy
()
{
return
true
;
return
appConfig
.
host
===
'
localhost
'
&&
appConfig
.
host
!==
appConfig
.
api
.
host
;
// return appConfig.host === 'localhost' && appConfig.host !== appConfig.api.host;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment