@opengis/fastify-table
Version:
core-plugins
20 lines (19 loc) • 712 B
JavaScript
import getAppSettings from "./controllers/properties.get.js";
import postAppSettings from "./controllers/properties.post.js";
const propertiesSchema = {
type: "object",
properties: {
params: {
id: { type: "string", pattern: "^([\\d\\w]+)$" },
key: { type: "string", pattern: "^([\\d\\w._]+)$" },
},
querystring: {
json: { type: "string", pattern: "^([\\d\\w]+)$" },
},
},
};
function plugin(app, opt = {}) {
app.get("/settings-app/:entity?", { config: { policy: "L0" }, schema: propertiesSchema }, getAppSettings);
app.post("/settings-app/:entity?", { config: { role: "admin" } }, postAppSettings);
}
export default plugin;