jeremydaly / jeremydaly/lambda-api
CORS issues , preflight is working
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 127
- Avg merge
- 31m
- Merged PRs (30d)
- 2
Description
i tried all method , but still exist cors issue,
in my case preflight connection working properly it returns 200
But actual response fail
here , my code is
`const app = require("lambda-api")();
app.use((req, res, next) => {
res.cors();
next();
});
app.get("/connect", async (req, res) => {
return res.send({ status: "testing" });
});
app.options("/*", (req, res) => {
res.cors();
return res.status(200).json({});
});
module.exports.connect = async (event, context) => {
return await app.run(event, context);
};`
@btakita
thank you
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported app with the /connect route, middleware res.cors(), and the app.options("/*") handler. Inspect the actual response headers from the request after a successful preflight and compare them with the expected CORS headers. Done means the actual response succeeds cross-origin, not only the preflight.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript, node.js
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100