feat: Add Cognito user pool name parameter and update API handlers to include CORS headers

This commit is contained in:
2024-11-23 11:12:46 +02:00
parent 59c0c97252
commit 5f9ee29c8d
14 changed files with 103 additions and 47 deletions

View File

@@ -30,13 +30,19 @@ export const handler = async (event: any): Promise<any> => {
return {
statusCode: 201,
headers: { "Content-Type": "application/json" },
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
},
body: JSON.stringify(newProject),
};
} catch (error: any) {
return {
statusCode: 500,
headers: { "Content-Type": "application/json" },
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
},
body: JSON.stringify({
message: `Error creating project: ${error.message}`,
}),