diff options
| author | Pitu <[email protected]> | 2019-02-19 00:06:38 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-02-19 00:06:38 +0900 |
| commit | e33cf304495d327b152a01cc6906643ccd8dd62a (patch) | |
| tree | 1e98761a19d03c97621b95873464d1acea428a75 /src/api | |
| parent | CRLF to LF (diff) | |
| download | host.fuwn.me-e33cf304495d327b152a01cc6906643ccd8dd62a.tar.xz host.fuwn.me-e33cf304495d327b152a01cc6906643ccd8dd62a.zip | |
Changes
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/routes/configGET.js | 22 | ||||
| -rw-r--r-- | src/api/structures/Server.js | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/api/routes/configGET.js b/src/api/routes/configGET.js new file mode 100644 index 0000000..4bc7e15 --- /dev/null +++ b/src/api/routes/configGET.js @@ -0,0 +1,22 @@ +const Route = require('../structures/Route'); +const config = require('../../../config'); + +class configGET extends Route { + constructor() { + super('/config', 'get', { bypassAuth: true }); + } + + run(req, res) { + return res.json({ + version: process.env.npm_package_version, + URL: config.filesServeLocatio, + baseURL: config.backendLocation, + serviceName: config.serviceName, + maxFileSize: config.uploads.uploadMaxSize, + chunkSize: config.uploads.chunkSize, + maxLinksPerAlbum: config.albums.maxLinksPerAlbum + }); + } +} + +module.exports = configGET; diff --git a/src/api/structures/Server.js b/src/api/structures/Server.js index 0b05570..5ead078 100644 --- a/src/api/structures/Server.js +++ b/src/api/structures/Server.js @@ -79,4 +79,4 @@ class Server { } } -module.exports = Server; +new Server().start(); |