Express-Server with Netlify functions

Hi @coelmay,

You have set the functions directory in the netlify.toml to functions , but the api.js function is in src .

Did you recognize that there a 2 branches in the repo? You refer to the “Express-branch” - this simple Express-server works fine. toml-file isn’t needed.
The “function” branch is the one which serves the corrupted file.

You have set included_files to ["**.xlsX"] (note the uppercase X ) though the filename is xlsx (all lowercase)

OK, you are right, but it has no consequence. As written above - the express-server works fine.

included_files need to site under the [functions] section of the netlify.toml e.g.

[functions]
  directory = "functions"
  [functions.api]
    included_files = ["src/*.xlsx"]

Look “functions”-branch

npm start won’t work with Netlify. You cannot have a listener, but it is possible to use express as outlined in How to run Express.js apps with Netlify Functions (you need to export a handler.)

npm start is just a script. In each branch it runs different commands. See each package.json. In “function”-branch there is a exported handler.