I have used an html contact form template found online for my static website hosted on aws. The html contact form in its head section is linked to a js script with a formula, provided together with the html template. Behind that on aws I have created a lambda formula to fetch the massages via ..
Category : aws-api-gateway
I was trying to get event.body.data, but it keep return me undefined, i tried JSON.parse(event), JSON.parse(event.body), JSON.parse(event.body.data), JSON.stringify, almost tried out things that i can do with JSON and non of them seems to work. When i tried JSON.parse(event), will give syntax error. So i suspect it already in JSON object format and when i ..
I have a simple lambda setup in node js with serverless.yml and handler.js. I want to conditionally send different headers as the response to my handler functions. I am using a function called setHeaders to check the origin of the request. If the origin (frontend domain) is as expected, access-control-allow-origin is set as the origin ..
I am running into a CORS problem which says that I’m unable to load my webpage due to the following: "Access to fetch at ‘ALB Load balancer dns address:port’ from origin ‘ALB Load balancer dns address’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response ..
I am trying to pass a simple key1 parameter through an HTTP API to my Lambda Function. When I do a test it works when I pass a simple value {"key1": "value1"}, however, when I use my HTTP API connected to the lambda function to make the same call using Postman, it returns undefined instead ..
I have an AWS Lambda function written in python that is initiated by a Zapier trigger that I set up. As I pass some input parameters to the function in the Zapier trigger, I can access to the input parameters in my python code by using variables such as event[parameter1]. It perfectly works. I’m trying ..
I am working on a cdk deploy script and I have it somewhat working but am lost/not having luck setting the different stages and applying different lambdas to the api resources. So I have // Construct lambdas – prod const lambdaBacklogGet = new lambdajs.NodejsFunction(this, "name", { nodeModules: [‘axios’], entry: ‘./src/path/index.js’, handler: ‘handler’, runtime: lambda.Runtime.NODEJS_12_X, timeout: ..
I have created a serverless express app and deploy it to aws. When I tried to access the endpoint from my front end application. I got the following error: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Here is my express app: app.use((req, res, next) => { res.append(‘Access-Control-Allow-Origin’, ‘*’); res.append(‘Access-Control-Allow-Methods’, ‘GET,PUT,POST,DELETE’); res.append(‘Access-Control-Allow-Headers’, ‘*’); next(); ..
I have a simple AWS Lambda function as shown below: exports.handler = async function (event, context) { console.log(‘Received event:’, event); context.done(null, JSON.stringify({"status": "success"})); }; it merely logs the event. My main problem is that I am not getting the event body when I use jQuery Ajax to send requests, but I get the event body ..
I activated CORS on a POST method using the console to allow my resource on https://api.example.com/dev/contact to be called from my website on http://subdomain.example.com. I am using JS Fetch to send the request, but the response is always the same: [Error] Origin http://subdomain.example.com is not allowed by Access-Control-Allow-Origin. [Error] Fetch API cannot load https://api.example.com/dev/contact due ..
Recent Comments