In Aggie Experts, we need the ability to make HEAD requests and get a response that shows whether the document exists in ES.
In the current use case, we'd like to make a HEAD request to see if an expert exists in the app, and if not, we'd like to hide a link to the experts' profile.
Currently, the GET route in default-api.js is returning a 200 status code as an error, but with the HEAD request there is no body describing the error.
Something like this could work-
Although I'm not sure which status code we'd want to return. Or we could create a HEAD route instead of letting Express default to the GET route.
This is related.
In Aggie Experts, we need the ability to make HEAD requests and get a response that shows whether the document exists in ES.
In the current use case, we'd like to make a HEAD request to see if an expert exists in the app, and if not, we'd like to hide a link to the experts' profile.
Currently, the GET route in
default-api.js
is returning a 200 status code as an error, but with the HEAD request there is no body describing the error.Something like this could work-
Although I'm not sure which status code we'd want to return. Or we could create a HEAD route instead of letting Express default to the GET route.