CodeGenieApp / CodeGenieApp/serverless-express
Incompatibility with AWS API Gateway
- Lingua principale
- JavaScript
- Stelle
- 5.3k
- Fork
- 676
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Vendia's `serverless-express` package does not work as expected with AWS API Gateway, it only returns a blank screen instead the swagger screen.
This issue is forcing us to use the `serverless-http` package.
To reproduce the error, you basically have to:
1) Create an AWS Lambda function* with a simple project containing express, serverless-http or vendia and swagger;
2) Configure the AWS API Gateway to consume the Lambda function created in the step 1.
*Node versions tried: 14/16/18/20
BTW. Using AWS Lambda function URLs Vendia's `serverless-express` package works pretty fine with swagger.
Example of a simple project containing express, serverless-http or vendia and swagger:
```
const express = require('express')
const serverless = require('serverless-http')
const swaggerUI = require('swagger-ui-express')
const app = express()
app.use(
'/swagger',
swaggerUI.serve,
swaggerUI.setup(null, {
swaggerOptions: {
url: "https://petstore.swagger.io/v2/swagger.json"
}
})
)
module.exports.handler = serverless(app)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’esempio Express minimale nell’issue e riproducilo dietro AWS API Gateway utilizzando le versioni di Node elencate. Confronta il comportamento con le Lambda function URLs e l’alternativa serverless-http; il lavoro è completato quando l’handler Vendia serverless-express esegue il rendering di Swagger UI tramite API Gateway invece di restituire una schermata vuota.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, express, javascript, node.js
- Ambito
- api, backend, cloud
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 28/100