Commit 3a0b4330 authored by Carolina Gilabert's avatar Carolina Gilabert

Adding CORS config to the lambda.

parent f4a4c944
......@@ -19,6 +19,17 @@ const listDirectories = params => {
exports.handler = async (event) => {
if (event.httpMethod === 'OPTIONS') {
return {
statusCode: 200,
statusDescription: '200 OK',
isBase64Encoded: false,
headers: {
"Access-Control-Allow-Origin": "*"
}
};
}
const objects = await listDirectories();
// TODO implement
......@@ -27,6 +38,7 @@ exports.handler = async (event) => {
statusDescription: '200 OK',
isBase64Encoded: false,
headers: {
"Access-Control-Allow-Origin": "*",
"Content-Type": "text/json; charset=utf-8"
},
body: JSON.stringify(objects),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment