CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-services

A less expensive TinyController.connected()

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.