refactor(express): split pingExpress into v1 and v2#8563
refactor(express): split pingExpress into v1 and v2#8563rishikeshdadam136 wants to merge 1 commit intomasterfrom
Conversation
37d34ec to
bf896ac
Compare
bf896ac to
9e50234
Compare
| } | ||
|
|
||
| function handlePingExpress(req: ExpressApiRouteRequest<'express.pingExpress', 'get'>) { | ||
| function handlePingExpress(req: ExpressApiRouteRequest<'express.pingexpress', 'get'>) { |
There was a problem hiding this comment.
handlePingExpress is wired to both express.v1.pingexpress and express.pingexpress, but the parameter type only mentions express.pingexpress. Update to ExpressApiRouteRequest<'express.v1.pingexpress' | 'express.pingexpress', 'get'> so the type matches both registrations.
There was a problem hiding this comment.
Update comments so it matches the split
There was a problem hiding this comment.
Add a minimal test that both GET /api/v1/pingexpress and GET /api/v2/pingexpress resolve and return the expected payload
9e50234 to
aa26509
Compare
| * Ping BitGo Express | ||
| * | ||
| * @operationId express.pingExpress | ||
| * @tag express | ||
| * Ping bitgo express to ensure that it is still running. Unlike /ping, this does not try connecting to bitgo.com. | ||
| * | ||
| * @operationId express.pingexpress | ||
| * @tag Express | ||
| * @public | ||
| */ | ||
| export const GetPingExpress = httpRoute({ | ||
| path: '/api/v[12]/pingexpress', | ||
| export const GetV2PingExpress = httpRoute({ | ||
| path: '/api/v2/pingexpress', |
There was a problem hiding this comment.
| * Ping BitGo Express | |
| * | |
| * @operationId express.pingExpress | |
| * @tag express | |
| * Ping bitgo express to ensure that it is still running. Unlike /ping, this does not try connecting to bitgo.com. | |
| * | |
| * @operationId express.pingexpress | |
| * @tag Express | |
| * @public | |
| */ | |
| export const GetPingExpress = httpRoute({ | |
| path: '/api/v[12]/pingexpress', | |
| export const GetV2PingExpress = httpRoute({ | |
| path: '/api/v2/pingexpress', | |
| * Ping BitGo Express | |
| * | |
| * Ping BitGo Express to ensure that it's still running. Unlike [Ping](/reference/expressping), this endpoint doesn't connect to bitgo.com. | |
| * | |
| * @operationId express.pingexpress | |
| * @tag Express | |
| * @public | |
| */ | |
| export const GetV2PingExpress = httpRoute({ | |
| path: '/api/v2/pingexpress', |
I'm still not sure how does this endpoint differs from /api/v2/ping that we currently instruct clients to use. How does it tell if Express is running?
There was a problem hiding this comment.
/api/v2/ping checks if both Express and BitGo servers are reachable — if BitGo is down, it fails even though Express is fine.
/api/v2/pingexpress only checks if Express itself is running — it never contacts BitGo, so it always returns 200 as long as the Express process is alive.
So when pingexpress returns 200 { "status": "express server is ok!" }, that itself is the proof — the fact that the request was received and responded to means Express is alive and handling requests.
aa26509 to
edcceec
Compare
Ticket: WCI-188
Context - https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B
The API behavior is not changing. We are splitting the combined v[12] route into two separate V1 and V2 routes, so both will continue to work and clients will not be affected.