1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-16 05:07:29 +00:00

Add /settings.json API as requested by Edward

This commit is contained in:
Cadence Ember 2022-07-27 10:41:48 +12:00
parent a9c7923b2c
commit dc0a80d1cb
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17

View File

@ -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)