-
Notifications
You must be signed in to change notification settings - Fork 6
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 Implementation #3
Comments
Implemented API to pull images with EXIF data using the code that was presented in the meeting with a few minor changes |
Hey @NerdsvilleCEO can you please provide the latest API spec you envision publishing? I would assume for this initial release I would be talking to http://localhost/ so what are the URLs I should look into consuming from your Flask App? Today I hope to send over a starting collection of html, css and js to lay the foundation for the mapping page. Thanks! |
@cgoodale I will prepare this in a bit and get it to you as soon as possible. |
@cgoodale http://localhost:5000/api/v1/images/ will accept GET and POST, I can just spit out the information in the DB with a GET and the image with a POST including image name as param image="image_name.jpg", is that how you would like it to work? For example Request: Response: Request: Params for request: Response: |
@NerdsvilleCEO that sounds like it will work. I will play around with the response and see if there is any other information I might want to fetch. Thanks! |
@cgoodale On second thought, do we need the POST? If we have the image name, we can store it in JS, and we will know the path since we are saying the images. Maybe there is something I am forgetting about, it can be easily implemented but if it's not needed, I will just do the GET. I was reading my comment last night and realized how redundant it was |
So we begin the classic debate over API design. I hope that others in the group follow along and see how we debate this. This is a small scale example so we can make several trades and shortcuts, but I think it would be great to highlight the pros & cons of different approaches. Scenario 1:
Pros:
Cons:
Considerations:
|
Ah, I see, was not considering larger scale, but that does make sense and would be better practice in my opinion, (keeping in mind I am a novice to API's) the network latency issue for a larger scale app would be the only potential issue with this approach, but since we are running on localhost and it is a demonstration there isn't an issue, so this is the plan, with a: GET request I will go ahead and spit out primary ID, long and lat for you to plot on the map, POST request Does that makes sense? Let me know if this design would work, if so I will get started on designing it in this manner Thanks! |
@NerdsvilleCEO I think we are in agreement on this. I realize we could send all data in one simple GET request, but that means we would only have one end point to discuss and demo for the project. Two isn't a ton of endpoints but we can talk about using GET vs. POST and talk about some of the decisions and trade-offs when designing APIs. I am looking forward to seeing how the service will behave and getting some data on the map soon. Thanks! |
Finally had a little time to breath with all the work I have been needing to do, the GET endpoint has been completed and I made a pull request. Thanks! |
Hey @NerdsvilleCEO please grab the latest code and give it a whirl on your machine. Once you start up the flask app, just open the index.html and you should see a map with some points (assuming you have some points in your local db already). Let me know if you find any issues. Cheers! |
Doing that right now |
It totally works! :) That is awesome |
Slight bug, it makes a POST even when you click off the marker |
Looking back 6 years later, this implementation has some major issues. I'll try and fix some of them today. |
No description provided.
The text was updated successfully, but these errors were encountered: