Use query variable to force update check

This commit is contained in:
Asher 2020-11-03 16:13:41 -06:00
parent a653b93ce2
commit c5ce365482
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
1 changed files with 2 additions and 13 deletions

View File

@ -12,19 +12,8 @@ router.use((req, _, next) => {
next()
})
router.get("/", async (_, res) => {
const update = await provider.getUpdate()
res.json({
checked: update.checked,
latest: update.version,
current: version,
isLatest: provider.isLatestVersion(update),
})
})
// This route will force a check.
router.get("/check", async (_, res) => {
const update = await provider.getUpdate(true)
router.get("/", async (req, res) => {
const update = await provider.getUpdate(req.query.force === "true")
res.json({
checked: update.checked,
latest: update.version,