Cannot access API explorer on localhost

后端 未结 11 1362
南方客
南方客 2020-12-08 16:10

I\'m trying to build an Endpoints application, but am new to Google App Engine.

As I understand it, there\'s some kind of API Explorer included in the SDK that shoul

相关标签:
11条回答
  • 2020-12-08 16:42

    The URL for the API Explorer is correct, but there have been some issues (apparently not all resolved) where the API Explorer doesn't correctly list your APIs.

    As comparison of how it should look like https://developers.google.com/apis-explorer/ is the API Explorer for Google APIs, far more APIs than you would normally host yourself, but just to give you an idea of what you should see: a list of APIs and details for each API once you click on it.

    A workaround that usually worked is to explicitly add the name and version of your API to the URL, so since your API is called scrnxSync with version v1 this link should show you the methods you defined for your API, and allow you to call those methods:

    https://developers.google.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/scrnxSync/v1/

    0 讨论(0)
  • 2020-12-08 16:46

    I know it is not exactly the same problem but I was having the message "You are exploring an API that is described or served via HTTP instead of HTTPS. This is insecure and may be blocked by your browser. To fix this, set up a TLS proxy for your API. Alternatively, you can tell your browser to allow active content via HTTP at this site (on Chrome, click the shield in the URL bar), but this will not improve security or dismiss this message."

    Clicking the shield icon in the address bar of Chrome did it for me.

    0 讨论(0)
  • 2020-12-08 16:51

    I was having the same issue but it turned out that I was specifying the wrong port on localhost. When the dev server(s) start up the log specifies three discreet ports on localhost:

    INFO 2015-07-26 03:46:56,023 api_server.py:172] Starting API server at: http:// localhost:35714

    INFO 2015-07-26 03:46:56,027 dispatcher.py:186] Starting module "default" running at: http:// localhost:8080

    INFO 2015-07-26 03:46:56,028 admin_server.py:118] Starting admin server at: http:// localhost:8000

    The issue was that I was trying to use the port for the api server but you need to just use the port for the default module.

    This works: http:// localhost:8080/_ah/api/explorer (I needed to click the shield in chrome and allow unsafe scripts because the url is unencrypted)

    0 讨论(0)
  • 2020-12-08 16:54

    The problem is that your python file can't find the import for:

    from protorpc import remote
    

    Therefore use the terminal, skip the GUI, navigate to the appengine sdk directory and put your project in there. For mac it is:

    /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/
    
    0 讨论(0)
  • 2020-12-08 16:56

    Something changed, and now you must start Chrome in a specific way to use api explorer on localhost development server

    here is a link to info from google.

    But for me it still didn't fix using api explorer with localhost dev server.
    I find that a possible workaround is to launch Chrome with the flag "--allow-running-insecure-content"
    On MacOs in terminal run this:

    /Applications/Google\ Chrome.app/Contents/Mac/Google\ Chrome --user-data-dir=test --allow-running-insecure-content

    0 讨论(0)
  • 2020-12-08 16:56

    For me, it is a very simple typo in app.yaml. If you have the same problem, it can be just this simple:

    Instead of (which is correct):

    - url: /_ah/spi/.*
      script: services.application
    

    I put:

    - url: /_ah/api/.*
      script: services.application
    

    Changing api back to spi did the trick.

    0 讨论(0)
提交回复
热议问题