From dc0a80d1cb47c64e120f3be804877af37fe67990 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 27 Jul 2022 10:41:48 +1200 Subject: [PATCH] Add /settings.json API as requested by Edward --- src/site/api/settings.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/site/api/settings.js b/src/site/api/settings.js index f59af1f..7256a52 100644 --- a/src/site/api/settings.js +++ b/src/site/api/settings.js @@ -7,6 +7,17 @@ const crypto = require("crypto") const db = require("../../lib/db") module.exports = [ + { + route: "/settings.json", methods: ["GET"], code: async ({req, url}) => { + const token = getToken(req) + const settings = getSettings(req) + return { + statusCode: 200, + contentType: "application/json", + content: settings + } + } + }, { route: "/settings", methods: ["GET"], code: async ({req, url}) => { const token = getToken(req)