cleanup server_data.js

Co-Authored-By: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
acalcutt 2024-12-29 03:09:09 -05:00
parent d52154605a
commit 279421c349

View file

@ -21,7 +21,13 @@ import { gunzipP, gzipP } from './promises.js';
import { openMbTilesWrapper } from './mbtiles_wrapper.js'; import { openMbTilesWrapper } from './mbtiles_wrapper.js';
export const serve_data = { export const serve_data = {
init: (options, repo) => { /**
* Initializes the serve_data module.
* @param {object} options Configuration options.
* @param {object} repo Repository object.
* @returns {express.Application} The initialized Express application.
*/
init: function (options, repo) {
const app = express().disable('x-powered-by'); const app = express().disable('x-powered-by');
app.get('/:id/:z/:x/:y.:format', async (req, res) => { app.get('/:id/:z/:x/:y.:format', async (req, res) => {
@ -325,7 +331,16 @@ export const serve_data = {
return app; return app;
}, },
add: async (options, repo, params, id, publicUrl) => { /**
* Adds a new data source to the repository.
* @param {object} options Configuration options.
* @param {object} repo Repository object.
* @param {object} params Parameters object.
* @param {string} id ID of the data source.
* @param {string} publicUrl Public URL of the data.
* @returns {Promise<void>}
*/
add: async function (options, repo, params, id, publicUrl) {
let inputFile; let inputFile;
let inputType; let inputType;
if (params.pmtiles) { if (params.pmtiles) {