Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: API URLs issue #97 #98

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
BUILD_ENV=
COMMUNITY_API_KEY=
THEGRAPH_API_KEY=
REALTOKENAPI='https://api.realtoken.community/v1/token'
REALTOKENAPI_HISTORY='https://history.api.realtoken.community/'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ To run the project you will need to set-up a `.env` file in the root folder:
```
COMMUNITY_API_KEY=XXXXXXXXXXXX
THEGRAPH_API_KEY=XXXXXXXXXXXX

REALTOKENAPI='https://api.realtoken.community/v1/token'
REALTOKENAPI_HISTORY='https://history.api.realtoken.community/'
```

To get a `COMMUNITY_API_KEY`, join the dedicated [telegram dev channel](https://t.me/+XQyoaFfmN61yk7X0) then ask for.
Expand Down
6 changes: 4 additions & 2 deletions src/pages/api/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const getRealTokenHistory = useCache(
if (!process.env.COMMUNITY_API_KEY) {
throw new Error('Missing COMMUNITY_API_KEY env variable')
}

const response = await fetch('https://history.api.realt.community/', {
if (!process.env.REALTOKENAPI_HISTORY) {
throw new Error('Missing REALTOKENAPI_HISTORY env variable')
}
const response = await fetch(process.env.REALTOKENAPI_HISTORY, {
method: 'GET',
headers: { 'X-AUTH-REALT-TOKEN': process.env.COMMUNITY_API_KEY },
})
Expand Down
6 changes: 4 additions & 2 deletions src/pages/api/properties/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const getRealTokenList = useCache(
if (!process.env.COMMUNITY_API_KEY) {
throw new Error('Missing COMMUNITY_API_KEY env variable')
}

const response = await fetch('https://api.realt.community/v1/token', {
if (!process.env.REALTOKENAPI) {
throw new Error('Missing REALTOKENAPI env variable')
}
const response = await fetch(process.env.REALTOKENAPI, {
method: 'GET',
headers: { 'X-AUTH-REALT-TOKEN': process.env.COMMUNITY_API_KEY },
})
Expand Down
Loading