cmneal26 / Tech-Writing-Project

Class repository
2 stars 1 forks source link

Handling HTTP API endpoint #101

Closed ghost closed 2 years ago

ghost commented 2 years ago

We can dump all 10k analyte records from the excel file in a db, and ill make them available via an endpoint.

ghost commented 2 years ago

@twalker

@cmneal26 Can you send me a google drive link or something like that for the excel file? I'm going to put it in a database, and make that data accessible, so we can call an api to retrieve the analyte info, and we can use all 10k records, and not have to do a fake thing like having only some searchable.

ghost commented 2 years ago

started api project: https://github.com/ingrey1/free-free-education-api

ghost commented 2 years ago

Oh, this endpoint is https. I don't need the api server for this then. I'm still going to put it up though, at least we can use it for making the analyte data accessible via an endpoint.

ghost commented 2 years ago

I'm not exactly sure of the analyte property data types. So, in the postgres cloud db, gonna store them as json.

base url will be endpoint will be: something-heroku-weird.com/analytes

query params available: ?name=analyte-name-or-id

full url: something-heroku-weird.com/analytes?name=analyte-name-or-id

ghost commented 2 years ago

returned data will be like this, but json:

{data: [{name: analyte1, id: 1}]}
ghost commented 2 years ago

@cmneal26

Those 833 analytes you gave me are now in a cloud Postgres database. I'll add the application code to setup the API by sometime next week.

migrated-to-cloud query-analyte
ghost commented 2 years ago

Successful GET REQUEST TO ANALYTES API

Screen Shot 2022-07-24 at 6 12 42 PM

Unsuccessful GET REQUEST (missing 'name' query param)

Screen Shot 2022-07-24 at 6 13 15 PM
ghost commented 2 years ago

Complete. The code for the api deployed to Heroku: https://github.com/ingrey1/analytes-api

ghost commented 2 years ago

@cmneal26