UNPKG

@opengis/bi

Version:

BI data visualization module

33 lines (28 loc) 1.23 kB
import map from './controllers/map.js'; import geojson from './controllers/geojson.js'; import vtile from './controllers/vtile.js'; import cluster from './controllers/cluster.js'; import clusterVtile from './controllers/clusterVtile.js'; import heatmap from './controllers/heatmap.js'; const biSchema = { type: 'object', properties: { querystring: { widget: { type: 'string', pattern: '^([\\d\\w]+)$' }, dashboard: { type: 'string', pattern: '^([\\d\\w]+)$' }, sql: { type: 'string', pattern: '^([\\d])$' }, }, params: { id: { type: 'string', pattern: '^([\\d\\w]+)$' }, }, }, }; const policy = ['public']; export default async function route(fastify, opts) { fastify.get('/bi-map', { config: { policy }, schema: biSchema }, map); fastify.get('/bi-geojson', { config: { policy }, schema: biSchema }, geojson); fastify.get('/bi-vtile/:z/:y/:x', { config: { policy }, schema: biSchema }, vtile); fastify.get('/bi-cluster', { config: { policy }, schema: biSchema }, cluster); fastify.get('/bi-cluster-vtile/:z/:y/:x', { config: { policy }, schema: biSchema }, clusterVtile); fastify.get('/bi-heatmap', { config: { policy } }, heatmap); }