CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-services
A less expensive TinyController.connected()
Open
enhancement
question
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Current** (4/1/24)
```javascript
/**
* Generally check that the TinyPEN API is running.
* Perform a query for an object we know is there.
* @return boolean
* */
async connected() {
// Send a /query to ping TinyPen
try{
// FIXME something less expensive
const theone = await this.find({ "_id": "11111" })
return theone.length === 1
} catch(err){
console.error(err)
return false
}
}
```
Is it possible to do something less expensive, such as a `HEAD` request of some kind instead?
Contributor guide
Assessment
This issue has not been assessed yet.