Kabo Mekgwe
06/15/2022, 5:42 PMthdxr
06/15/2022, 5:55 PMthdxr
06/15/2022, 5:55 PMKabo Mekgwe
06/15/2022, 7:18 PMexport function MyStack({ stack }: StackContext) {
const api = new Api(stack, "api", {
routes: {
"GET /test": {
authorizer: "none",
function: "functions/lambda.handler"
},
},
cors: {
allowOrigins: ["<http://localhost:3000>"],
allowMethods: ["GET", "DELETE", "PUT", "POST", "PATCH", "OPTIONS"],
allowHeaders: ["Access-Control-Allow-Headers", "Origin", "Accept", "X-Requested-With", "Content-Type",
"Access-Control-Request-Method", "Access-Control-Request-Headers"],
allowCredentials: true
},
});
stack.addOutputs({
ApiEndpoint: api.url,
});
}
https://tnlcc4ff98.execute-api.us-east-1.amazonaws.com
This is the end point i am hitting as a result.
Using postman/browser i am able to get results, but through nextjs i am unable toKabo Mekgwe
06/15/2022, 8:26 PM