CodeGenieApp / CodeGenieApp/serverless-express

both express.static and res.sendFile return wrong binary when serving a zip file

Open
#677 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
676
PR merge metrics
No merged PRs in 30d

Description

I'm not using any middleware except express.json and cors.

this is lambda.ts

```
import serverlessExpress from "@codegenie/serverless-express";
import app from "./app";
exports.handler = serverlessExpress({
app,
binaryMimeTypes: ["application/x-zip", "application/zip"],
});
```

I tried with and without specifying `binaryMimeTypes` and with and without the specific first route:

```ts
app.use("/done/ext.zip", (req, res) => {
res.sendFile(path.join(__dirname, "public/ext.zip"));
});
app.use("/done", express.static("public"));
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.