mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-01-06 20:16:58 +00:00
Add /settings.json API as requested by Edward
This commit is contained in:
parent
a9c7923b2c
commit
dc0a80d1cb
@ -7,6 +7,17 @@ const crypto = require("crypto")
|
|||||||
const db = require("../../lib/db")
|
const db = require("../../lib/db")
|
||||||
|
|
||||||
module.exports = [
|
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}) => {
|
route: "/settings", methods: ["GET"], code: async ({req, url}) => {
|
||||||
const token = getToken(req)
|
const token = getToken(req)
|
||||||
|
Loading…
Reference in New Issue
Block a user