Skip to content

Commit

Permalink
Use Hosted URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Sep 10, 2024
1 parent 8b596d8 commit 04eb9d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions api/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export default class Config {
} else {
if (!process.env.StackName) throw new Error('StackName env must be set');
if (!process.env.API_URL) throw new Error('API_URL env must be set');
if (!process.env.PMTILES_URL) throw new Error('PMTILES_URL env must be set');
if (!process.env.ASSET_BUCKET) throw new Error('ASSET_BUCKET env must be set');

HookURL = process.env.HookURL;
Expand Down Expand Up @@ -163,7 +162,7 @@ export default class Config {
nosinks: (args.nosinks || false),
nocache: (args.nocache || false),
TileBaseURL: process.env.TileBaseURL ? new URL(process.env.TileBaseURL) : new URL('./data-dev/zipcodes.tilebase', import.meta.url),
PMTILES_URL: process.env.PMTILES_URL || 'http://localhost:5001',
PMTILES_URL: new URL(API_URL).host === 'localhost' ? 'http://localhost:5001' : `https://tiles.${new URL(API_URL).host}`,
StackName: process.env.StackName,
wsClients: new Map(),
server, SigningSecret, API_URL, DynamoDB, Bucket, pg, models, HookURL
Expand Down
1 change: 0 additions & 1 deletion cloudformation/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ export default {
{ Name: 'StackName', Value: cf.stackName },
{ Name: 'ASSET_BUCKET', Value: cf.ref('AssetBucket') },
{ Name: 'API_URL', Value: cf.join(['https://', cf.ref('HostedURL')]) },
{ Name: 'PMTILES_URL', Value: cf.join(['https://', cf.ref('PMTilesLambdaAPI'), '.execute-api.', cf.region, '.amazonaws.com']) },
{ Name: 'AWS_DEFAULT_REGION', Value: cf.region },
{ Name: 'VpcId', Value: cf.importValue(cf.join(['coe-vpc-', cf.ref('Environment'), '-vpc'])) },
{ Name: 'SubnetPublicA', Value: cf.importValue(cf.join(['coe-vpc-', cf.ref('Environment'), '-subnet-public-a'])) },
Expand Down
4 changes: 2 additions & 2 deletions cloudformation/lib/pmtiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ export default {
Outputs: {
PMTilesAPI: {
Description: 'PMTiles API',
Value: cf.join(['https://', cf.ref('PMTilesLambdaAPI'), '.execute-api.', cf.region, '.amazonaws.com']),
Value: cf.join(['https://tiles.', cf.ref('HostedURL')])
Export: {
Name: cf.join([cf.stackName, '-pmtiles-api'])
Name: cf.join(['https://tiles.', cf.ref('HostedURL')])
}
}
}
Expand Down

0 comments on commit 04eb9d6

Please sign in to comment.