Comments (5)
Facing the same issue as well. My team wasn't keen on messing with the greedy path variable names since that would entail a relatively uncomfortable change in API Gateway. Our routes are well established and running well.
Another quick workaround is to delete event.pathParameters.proxy
if it exists and pass the edited event into serverlessExpress
. This way util.js
is forced to use event.path
.
from serverless-express.
Offending line is https://github.com/vendia/serverless-express/blob/0909ec4ffd09d9fd22538257b721b7d076d03732/src/event-sources/utils.js#LL7C21-L7C21
A quick workaround is to change the name of the greedy path variable in API Gateway e.g. rename {proxy+}
to {route+}
.
from serverless-express.
To add to @mohammedsahl comment - vendia v4 does not seem to be compatible with how AWS Amplify sets up REST endpoints in API Gateway (https://docs.amplify.aws/cli/restapi/restapi/#create-a-rest-api). Since AWS Amplify allows for varying auth levels per endpoint, and the auth checks are done by API Gateway, it uses /foo/{proxy+} rather than /{proxy+}.
To make this lib work with amplify, you have to do what @mohammedsahl describes in #648 (comment) or similar.
from serverless-express.
Can you try the v5 branch #649? We'll merge this after additional verification
from serverless-express.
Hey @brett-vendia. Unfortunately, it still doesn't seem to work. This event.multiValueQueryStringParameters in our event is null and so the params passed to to url.format()
are { pathname: '/<somePathParamter>', query: null }
If it helps our event has the following structure
{
"resource": "/foo/{proxy+}",
"path": "/foo/<PathParamter>",
...
"queryStringParameters": null,
"multiValueQueryStringParameters": null,
"pathParameters": {
"proxy": "<PathParamter>"
},
...
}
from serverless-express.
Related Issues (20)
- Logger doesn't work HOT 3
- [404 Not Found] API Gateway HTTP Protocol Path Matching with stage HOT 3
- `body` data not passed correctly to the express app HOT 1
- Unable to Stream Responses from AWS Lambda HOT 5
- Is there support for NodeJS Server from HTTP module HOT 1
- Pradeep wants to pay 0 USD to have this issue fixed
- NestJS & Unable to determine event source based on event HOT 5
- RIE instructions missing
- Incompatibility with AWS API Gateway HOT 8
- Binary Content Type with Dots or Other Regex
- @codegenie/serverless-express has not been release to npm HOT 2
- NestJS + PG Aurora Serverless cold start HOT 4
- Serverless with Node14 & Yarn unable to install @vendia/serverless-express via serverless package/deploy. Pulls latest @CodeGenieApp tag instead HOT 2
- "postbuild" commnad can't work in Windows HOT 3
- `Authorization` headers not passed properly through Api Gateway v1.
- Swagger for basic-starter nestjs template
- Failing works with files
- Support hyper-express HOT 2
- Potential Issue with getCurrentInvoke handling concurrent Lambda invocations HOT 1
- Handling custom EventBridge events HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-express.