aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2021-01-10 02:04:35 +0200
committerZephyrrus <[email protected]>2021-01-10 02:04:35 +0200
commit46ef63fb9f3c2688118a9d1511293128cfdfe4c9 (patch)
tree5fc64b84464938f05470aeccd6066ac33922f590 /src/api/routes
parentfeat: create settings schema (used for rendering and validating) (diff)
downloadhost.fuwn.me-46ef63fb9f3c2688118a9d1511293128cfdfe4c9.tar.xz
host.fuwn.me-46ef63fb9f3c2688118a9d1511293128cfdfe4c9.zip
feat: add dynamic settings page rendering based on the Joi object
Diffstat (limited to 'src/api/routes')
-rw-r--r--src/api/routes/service/configSchemaGET.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/api/routes/service/configSchemaGET.js b/src/api/routes/service/configSchemaGET.js
new file mode 100644
index 0000000..90befa9
--- /dev/null
+++ b/src/api/routes/service/configSchemaGET.js
@@ -0,0 +1,17 @@
+const Route = require('../../structures/Route');
+const { configSchema } = require('../../structures/Setting');
+
+class configGET extends Route {
+ constructor() {
+ super('/service/config/schema', 'get', { adminOnly: true });
+ }
+
+ run(req, res) {
+ return res.json({
+ message: 'Successfully retrieved schema',
+ schema: configSchema
+ });
+ }
+}
+
+module.exports = configGET;