UNPKG

@opengis/fastify-table

Version:

core-plugins

22 lines (21 loc) 615 B
import readItemList from "./controllers/readItems.js"; import setItem from "./controllers/setItem.js"; const policy = ["site"]; export default function plugin(app) { if (!app.hasRoute({ method: "GET", url: "/db-list" })) { app.route({ method: "GET", url: "/db-list", config: { policy }, handler: readItemList, }); } if (!app.hasRoute({ method: "GET", url: "/db-list/:id" })) { app.route({ method: "GET", url: "/db-list/:id", config: { policy }, handler: setItem, }); } }