Skip to content

Commit 0de112a

Browse files
committed
recreate gateway
1 parent 4fbb6ec commit 0de112a

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/__tests__/routes.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ describe('API Routes', () => {
334334
const res = await request(app).get('/v1/technologies');
335335
expect(res.headers['access-control-allow-origin']).toEqual('*');
336336
expect(res.headers['content-type']).toContain('application/json');
337-
expect(res.headers['cache-control']).toContain('no-cache');
337+
expect(res.headers['cache-control']).toContain('public');
338338
});
339339

340340
it('should include ETag headers for caching', async () => {

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ const setCORSHeaders = (res) => {
2626
const setCommonHeaders = (res) => {
2727
setCORSHeaders(res);
2828
res.setHeader('Content-Type', 'application/json');
29-
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
30-
res.setHeader('Pragma', 'no-cache');
31-
res.setHeader('Expires', '0');
29+
res.setHeader('Cache-Control', 'public, max-age=21600');
3230
res.setHeader('Timing-Allow-Origin', '*');
3331
};
3432

terraform/dev/main.tf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,25 @@ provider "google" {
1313

1414
resource "google_api_gateway_api" "api" {
1515
provider = google-beta
16-
api_id = "api-gw-dev"
17-
display_name = "The dev API Gateway"
16+
api_id = "reports-api"
17+
display_name = "Reports API Gateway"
1818
project = var.project
1919
}
2020

2121
# A Configuration, consisting of an OpenAPI specification
2222
resource "google_api_gateway_api_config" "api_config" {
2323
provider = google-beta
2424
api = google_api_gateway_api.api.api_id
25-
api_config_id_prefix = "api"
25+
api_config_id_prefix = "reports_api_config_dev"
2626
project = var.project
27-
display_name = "The dev Config"
27+
display_name = "Reports API Config DEV"
2828
openapi_documents {
2929
document {
3030
path = "spec.yaml"
3131
contents = base64encode(<<-EOF
3232
swagger: "2.0"
3333
info:
34-
title: reports-backend-api
35-
description: API tech report
34+
title: reports_api_config_dev
3635
version: 1.0.0
3736
schemes:
3837
- https
@@ -116,8 +115,8 @@ resource "google_api_gateway_gateway" "gateway" {
116115
project = var.project
117116
region = var.region
118117
api_config = google_api_gateway_api_config.api_config.id
119-
gateway_id = "dev-gw"
120-
display_name = "devApi Gateway"
118+
gateway_id = "reports-dev"
119+
display_name = "Reports API Gateway DEV"
121120
labels = {
122121
owner = "tech_report_api"
123122
environment = var.environment

0 commit comments

Comments
 (0)