mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-17 06:41:42 +00:00
Add an API endpoint for GETing server version
This commit adds an API endpoint to get the server version. This will be used to add the ability for the mobile app to show which server version the server you are currently connected to is running.
This commit is contained in:
parent
f916454c55
commit
b0d3d1edde
2 changed files with 10 additions and 0 deletions
|
|
@ -159,6 +159,15 @@ class MiscController {
|
|||
res.json(downloads)
|
||||
}
|
||||
|
||||
// GET: api/version
|
||||
async getServerVersion(req, res) {
|
||||
var version = {
|
||||
serverVersion: this.db.serverSettings.version
|
||||
}
|
||||
|
||||
return res.json(version)
|
||||
}
|
||||
|
||||
// PATCH: api/settings (admin)
|
||||
async updateServerSettings(req, res) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ class ApiRouter {
|
|||
this.router.delete('/download/:id', MiscController.removeDownload.bind(this))
|
||||
this.router.get('/downloads', MiscController.getDownloads.bind(this))
|
||||
this.router.patch('/settings', MiscController.updateServerSettings.bind(this)) // Root only
|
||||
this.router.get('/version', MiscController.getServerVersion.bind(this))
|
||||
this.router.post('/purgecache', MiscController.purgeCache.bind(this)) // Root only
|
||||
this.router.post('/authorize', MiscController.authorize.bind(this))
|
||||
this.router.get('/search/covers', MiscController.findCovers.bind(this))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue