diff options
| author | Pitu <[email protected]> | 2020-07-18 04:31:12 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2020-07-18 04:31:12 +0900 |
| commit | 8ffa0ba075a9d2b7b7409f9d11581a5237e7fd89 (patch) | |
| tree | c032ed5cfe8ed348cb52891106fc93ad5b36afc6 | |
| parent | Update TODO (diff) | |
| download | host.fuwn.me-8ffa0ba075a9d2b7b7409f9d11581a5237e7fd89.tar.xz host.fuwn.me-8ffa0ba075a9d2b7b7409f9d11581a5237e7fd89.zip | |
Add endpoint with version of the API
| -rw-r--r-- | src/api/routes/service/versionGET.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/api/routes/service/versionGET.js b/src/api/routes/service/versionGET.js new file mode 100644 index 0000000..dfb994a --- /dev/null +++ b/src/api/routes/service/versionGET.js @@ -0,0 +1,15 @@ +const Route = require('../../structures/Route'); + +class versionGET extends Route { + constructor() { + super('/version', 'get', { bypassAuth: true }); + } + + run(req, res) { + return res.json({ + version: process.env.npm_package_version + }); + } +} + +module.exports = versionGET; |