/polis-api-proxy

A Pol.is API proxy for experimenting with different API design choices.

Primary LanguageJavaScript

Pol.is API Proxy

This app proxies API calls in order to experiment with alternative API design choices.

These alternatives include:

  • CORS support as required by Swagger dynamic docs.
  • Token authentication (ie headers) rather than BasicAuth.
    • Before: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -u xxxxxxxx:
    • After: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
  • Primary resource ID in path param rather than query param.
    • Before: curl $BASE_URL/api/v3/conversations?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
    • After: curl $BASE_URL/api/v3/conversations/5mnfxu85hx -H Authorization:xxxxxxxx
  • Sub-resource rather than top-level resources.
    • Before: curl $BASE_URL/api/v3/participants?conversation_id=5mnfxu85hx -H Authorization:xxxxxxxx
    • After: curl $BASE_URL/api/v3/conversations/5mnfxu85hx/participants -H Authorization:xxxxxxxx