curl - apiaxle not working as expected -
i checking out apiaxle. able install follwoing documentation @ documentation. however, seems there problem now. after installing ran $ apiaxle-proxy -f 1 -p 3000 -q
stated in doc, got error xml file not appear have style information associated it. document tree shown below.
<error> <type>apiunknown</type> <message>no api specified (via subdomain)</message> </error>
now have application running @ localhost:9000. want apiaxle sit on top of , other links such localhost:9000/test , localhost:9000/test/param. begin doing added below highlighted code in /etc/hosts
file suggested docs. file looks like:
127.0.0.1 localhost 127.0.1.1 gbh-201505-0052 #apiaxle line , below added me 127.0.0.1 myapp.api.localhost
after this, when run $ apiaxle-proxy -f 1 -p 3000 -q
, hit http://myapp.api.localhost:3000/ see same error above.no change @ all. doc says error same different message. anyways, proceed create , add api commands:
$ apiaxle axle> api "myapp" create endpoint="localhost:9000" axle> key "1234" create axle> api myapp linkkey "1234"
now if $ curl 'http://myapp.api.localhost:3000/?api_key=1234'
or curl 'http://myapp.api.localhost:3000/test/param?api_key=1234'
perfect response expected. when copy paste same url in browser "web page not available error". if try stats or view apis apiunknown error. example tried below 3 commands , @ both got apiunknown error. commands were:
curl 'http://localhost:3000/v1/api' curl 'http://localhost:3000/v1/api' curl 'http://localhost:3000/v1/api/myapp/stats?granularity=hour&format_timstamp=iso'
the detailed error above:{"meta":{"version":1,"status_code":404},"results":{"error":{"type":"apiunknown","message":"no api specified (via subdomain)"}}}
if not strange, here 1 more interesting thing. if go apiaxle console , see apis , keys myapp there , being listed.
$apiaxle axle> apis [ 'myapp'] axle> keys [ '1234']
what happening? can me understand how this? documentation quite scarce in respect.
you need configure nginx.conf accept requests , proxy apiaxle. apiaxle docs start talk @ bottom.
the flow having nginx take request (say /nice_uri/123
, send information apiaxle, sends request endpoint
/test
on app server , gets response. can tell going endpoint
right off bat. want endpoint hidden, basically.
good luck , need grok all. ymmv of course, works if can on lack of support.
Comments
Post a Comment