-
Notifications
You must be signed in to change notification settings - Fork 44
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
enhance info endpoint and bump to v0.1.13
#117
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
==========================================
- Coverage 94.45% 94.23% -0.23%
==========================================
Files 25 25
Lines 2218 2237 +19
Branches 296 299 +3
==========================================
+ Hits 2095 2108 +13
- Misses 123 129 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least it is an improvement to blowing up. Though doesn't this depend on DWN_SERVER_VERSION
being available? I wonder if it is not possible to just read the package.json
file direclty.
v0.1.13
@thehenrytsai spent a little more time on it to make this a more thoughtful PR. Added some notes to the readme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎸 🎸 🎸
In a previous PR some(much desired) version information was added to the
/info
endpoint, however in certain environments(our docker container) this blows up.This PR prevents the endpoint from blowing up, while also providing some optionality and defaults to fall back on and bumps version to
v0.1.13
Added the text below to the
README.md
file:server
is read from theprocess.env.npm_package_name
variable thatnpm
provides. If that does not exist, it will check for aDWN_SERVER_PACKAGE_NAME
environment variable set by the user, or otherwise it will default to@web5/dwn-server
.version
andsdkVersion
are read from thepackage.json
file. It will locate the file's path either from theprocess.env.npm_package_json
variable thatnpm
provides. If that does not exist, it will check for aDWN_SERVER_PACKAGE_JSON
environment variable set by the user, or otherwise it will default to/dwn-server/package.json
which is the path within the default Docker container build.