Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api Creation #4

Closed
LeeroyJenkin opened this issue Jun 4, 2019 · 1 comment
Closed

Api Creation #4

LeeroyJenkin opened this issue Jun 4, 2019 · 1 comment

Comments

@LeeroyJenkin
Copy link

Hey I used the code mentioned to create an api : PYTHONPATH='.' python3 api/app.py

  • Serving Flask app "app" (lazy loading)
  • Environment: production
    WARNING: Do not use the development server in a production environment.
    Use a production WSGI server instead.
  • Debug mode: on
    [2019-06-04 12:21:48,060] INFO : * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    [2019-06-04 12:21:48,061] INFO : * Restarting with stat
    [2019-06-04 12:21:48,314] WARNING : * Debugger is active!
    [2019-06-04 12:21:48,318] INFO : * Debugger PIN: 370-660-369

However whenever i try accessing 127.0.0.1:5000 , the site cannot be reached.

@yardstick17
Copy link
Owner

Hey, I will suggest using the endpoint defined

    api.add_resource(ReadViaImage, ROOT_PATH + '/image')
    api.add_resource(ReadViaUrl, ROOT_PATH + '/url')

We we run the API server, it doesn't host anything on the root path(it is not like website you can visit.).
Access API like this

curl -X POST \
  http:///127.0.0.1:5000/read_image_from_file/url \
  -F url=https://africatalentbank.com/wp-content/uploads/2014/10/Menu.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants