-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show version, make ui dependent on api in docker (#912)
![Screenshot 2023-12-27 at 7 44 07 PM](https://github.com/PeerDB-io/peerdb/assets/65964360/e0ddd66d-c733-4c02-bc75-45acd02169ee) Docker compose changes: Figured it would be good to have ui start after the flow-api container
- Loading branch information
1 parent
f3d1d8e
commit 4425e20
Showing
5 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { UVersionResponse } from '@/app/dto/VersionDTO'; | ||
import { PeerDBVersionResponse } from '@/grpc_generated/route'; | ||
import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export async function GET() { | ||
const flowServiceAddr = GetFlowHttpAddressFromEnv(); | ||
try { | ||
const versionResponse: PeerDBVersionResponse = await fetch( | ||
`${flowServiceAddr}/v1/version` | ||
).then((res) => { | ||
return res.json(); | ||
}); | ||
let response: UVersionResponse = { | ||
version: versionResponse.version, | ||
}; | ||
return new Response(JSON.stringify(response)); | ||
} catch (error) { | ||
console.error('Error getting version:', error); | ||
return new Response(JSON.stringify({ error: error })); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type UVersionResponse = { | ||
version: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters