-
Notifications
You must be signed in to change notification settings - Fork 3
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
DSP-743 Support the api route /health #246
Conversation
@kilchenmann It is possible to get the headers from an RxJS ajax get request. getHealth(): Observable<ApiResponseData<HealthResponse> | ApiResponseError> {
return this.httpGet("").pipe(
tap(res => console.log(res.xhr.getResponseHeader("server"))),
map(ajaxResponse => ApiResponseData.fromAjaxResponse(ajaxResponse, HealthResponse, this.jsonConvert)),
catchError(error => this.handleError(error))
);
} I just print out the header using |
@kilchenmann I added the contents to the test data file in 64c159d |
@tobiasschweizer Would it be possible to add it to the response, or how would I read it in the app? |
Do you already have some logic to parse the server header param? |
I think we could add the server header param to If you want, I could work on this. |
No not yet |
Yes, this was my idea. Would be great if you can work on it. Thanks |
@kilchenmann 7b890c5 adds functionality to parse the header and add it to the health message. I will probably this in a utility file, so it can be called from the endpoint. Also I will add tests that check the error handling works as expected. |
@kilchenmann I think we should make a DSP task so we can get test data for the health response message. I don't know how we can get test data for the headers. |
I created https://dasch.myjetbrains.com/youtrack/issue/DSP-816 so Knora generates test data for the health route. |
Do we have to wait for it? Or can we update the tests in a later PR? |
I think we'll have to wait. I created https://dasch.myjetbrains.com/youtrack/issue/DSP-817. |
Ok, I will check this PR this morning. |
I am not allowed to review my PR myself. So, I approve the changes from @tobiasschweizer: It works well |
ok, the PR is good to go! |
resolves DSP-743