Skip to content

Commit f7355ca

Browse files
authored
Merge pull request #57 from helpfulengineering/issue-54-data-all-the-way
fixing cors problem
2 parents dbe3053 + e84f694 commit f7355ca

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/back-end/local.settings.json.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
"Azure_Storage_ServiceName": "https://projectdatablobstorage.blob.core.windows.net",
77
"Azure_Storage_OKH_ContainerName": "okh",
88
"Azure_Storage_OKW_ContainerName": "okw"
9+
},
10+
"Host": {
11+
"CORS": "*", // Allow all origins (for development)
12+
"CORS_AllowedOrigins": [
13+
"http://localhost:3000/"
14+
]
915
}
1016
}

packages/back-end/src/functions/httpFunctions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ export async function getFile(
229229
const data = await getOKHByFileName(fileName, containerName, fileType);
230230

231231
let productObj = { product: data };
232-
return { jsonBody: productObj};
232+
return { jsonBody: productObj,
233+
headers: { "Access-Control-Allow-Origin" : "*"}
234+
};
233235
}
234236

235237
// HELPER FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)