cleanup server_data.js
Co-Authored-By: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
61e81e0e61
commit
a0fb3680d0
1 changed files with 17 additions and 2 deletions
|
@ -18,7 +18,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) => {
|
||||||
|
@ -181,7 +187,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) {
|
||||||
|
|
Loading…
Reference in a new issue