pepfar-datim / mAtches

Data source to target mapping utility
Apache License 2.0
3 stars 1 forks source link

Make version (etc.,) accessible from api #92

Closed tomzemp closed 3 years ago

tomzemp commented 4 years ago

Need to know which version of app is deployed, e.g. on https://test.ohie.datim.org/mAtches/, so we can make this information available, with api being useful

possible items:

Could also incorporate simplified display on front-end from UI in Settings button

tomzemp commented 4 years ago

Hi @vshioshvili

I've added in an api/about to mAtches app with some basic information: {"appName":"mAtches","version":"1.0.1","buildDate":"2020-09-04T12:18:22.173Z","repository":{"type":"git","url":"https://github.com/pepfar-datim/mAtches"}}

I'm just pulling this information (server-side) from the package.json file (https://github.com/pepfar-datim/mAtches/blob/master/queries.js#L8)

I think this is okay security wise as I don't see any way for the contents of package.json to become more generally available client side, but let me know if you disagree.

I've looked around a bit at some other options for versioning:

tomzemp commented 3 years ago

Vlad and I discussed/clarified on April 19 that primary goal is to include/update the commit hash on build. I think we can handle this most easily by modifying the build script to update package.json (and should also update the build time). We can then expose the commit hash through the api similar to version number

tomzemp commented 3 years ago

@vshioshvili: I've modified the build to pull the latest commit: image

I think this is what you envisioned (so closing the ticket), but let me know if you want something else

FYI @FelixOngati