Skip to content

Demo/API example: use /api prefix with UI port

Nikolay Samokhvalov requested to merge nik-fix-api-urls into master

Originally, we use two separate ports for API and UI, but UI also comes with /api prefix redirecting to API server. This is convenient because it allows users to use a single port – e.g., to completely forget about ports and use default HTTPS one (443) for both UI and API requests.

For the demo server, we have two options:

From past experience, dealing with a single port and URI prefixes is more convenient for users (and admins: think setting up and maintaining certificates for HTTPS) than dealing with two separate ports, so I think we should encourage using UI port and for everything, and /api prefixes for API calls.

A known downside of this is that API calls start depending on the UI component – if it's down, users cannot work with API via UI port. This looks an acceptable issue to me, benefits are higher. We might need to think about reconsidering the routing to solve this in the future.

In swagger/openapi spec we have, the demo server examples in https://api.dblab.dev/ have a mistake, they use both prefix (/api) and original API port, not UI one. Let's fix it.

cc @bogdan.tsechoev @akartasov

Edited by Nikolay Samokhvalov

Merge request reports