Search code examples
apiblueprintapiary

How can I hit a local dev server from UI generated by apiary command line tool


I am using apiary preview --server to watch a file while editing it and have a UI generated.

I would like to hit a local dev server in the "Try" section of the UI, but when I hit "Call Resource", a request is made to POST https://jsapi.apiary.io/apis/null/http-transactions/.

HOST is set to http://localhost:3050 and I'm expecting it to hit that endpoint.

How can I change this?

$ apiary version 0.5.2

enter image description here


Solution

  • Currently, all console calls are routed via apiary.io servers to work around CORS limitations.

    If published, you can work around this limitation by exposing your local port using service such as ngrok.

    There is a testing of a version of the console that would make calls to the API directly and would utilise browser plugin if needed to get around CORS limitations. You should be able to utilise them soon.