From 4b55672cb149080a5819f1cb26c09fc512db488a Mon Sep 17 00:00:00 2001 From: Zack Pollard Date: Mon, 12 Aug 2024 19:12:38 +0100 Subject: [PATCH] chore: rename service and add VMMETRICS_API_TOKEN var --- tiles/src/env.d.ts | 4 +++- tiles/src/index.ts | 2 +- .../pmtiles/{pmtiles.ts => pmtiles.service.ts} | 0 tiles/worker-configuration.d.ts | 15 ++++++++------- tiles/wrangler.toml | 6 +----- 5 files changed, 13 insertions(+), 14 deletions(-) rename tiles/src/pmtiles/{pmtiles.ts => pmtiles.service.ts} (100%) diff --git a/tiles/src/env.d.ts b/tiles/src/env.d.ts index 651c613..7593fb1 100644 --- a/tiles/src/env.d.ts +++ b/tiles/src/env.d.ts @@ -1,5 +1,7 @@ -interface WorkerEnv extends Omit { +interface WorkerEnv + extends Omit { ENVIRONMENT: string; PMTILES_FILE_NAME: string; PMTILES_FILE_HASH: string; + VMMETRICS_API_TOKEN: string; } diff --git a/tiles/src/index.ts b/tiles/src/index.ts index 911d894..a2d8d35 100644 --- a/tiles/src/index.ts +++ b/tiles/src/index.ts @@ -1,5 +1,5 @@ import { Metrics } from './monitor'; -import { PMTilesService } from './pmtiles/pmtiles'; +import { PMTilesService } from './pmtiles/pmtiles.service'; import { CloudflareKVRepository, MemCacheRepository, R2StorageRepository } from './repository'; const URL_MATCHER = /^\/v(?[0-9]+)((?=)|(?\.json)|\/(?\d+)\/(?\d+)\/(?\d+).mvt)$/; diff --git a/tiles/src/pmtiles/pmtiles.ts b/tiles/src/pmtiles/pmtiles.service.ts similarity index 100% rename from tiles/src/pmtiles/pmtiles.ts rename to tiles/src/pmtiles/pmtiles.service.ts diff --git a/tiles/worker-configuration.d.ts b/tiles/worker-configuration.d.ts index 7c84b51..1780637 100644 --- a/tiles/worker-configuration.d.ts +++ b/tiles/worker-configuration.d.ts @@ -1,11 +1,12 @@ -// Generated by Wrangler on Mon Aug 12 2024 10:58:19 GMT+0100 (British Summer Time) +// Generated by Wrangler on Mon Aug 12 2024 19:11:53 GMT+0100 (British Summer Time) // by running `wrangler types` interface Env { - KV: KVNamespace; - PMTILES_FILE_NAME: 'v1.pmtiles'; - PMTILES_FILE_HASH: 'example-dev-hash'; - ENVIRONMENT: 'dev'; - BUCKET: R2Bucket; - CF_VERSION_METADATA: { id: string; tag: string }; + KV: KVNamespace; + PMTILES_FILE_NAME: "v1.pmtiles"; + PMTILES_FILE_HASH: "example-dev-hash"; + ENVIRONMENT: "development"; + VMMETRICS_API_TOKEN: "token"; + BUCKET: R2Bucket; + CF_VERSION_METADATA: { id: string; tag: string }; } diff --git a/tiles/wrangler.toml b/tiles/wrangler.toml index 751d70e..ba9644b 100644 --- a/tiles/wrangler.toml +++ b/tiles/wrangler.toml @@ -25,8 +25,4 @@ binding = "CF_VERSION_METADATA" PMTILES_FILE_NAME = "v1.pmtiles" PMTILES_FILE_HASH = "example-dev-hash" ENVIRONMENT = "development" - -[env.prod] -name = "tiles" -[vars] -ENVIRONMENT = "production" +VMMETRICS_API_TOKEN = "token"