So this is my scripts in package.json
"start": "npm run start:app && npm run start:lambda",
"start:app": "react-scripts start",
"start:lambda": "netlify-lambda serve netlify/functions",
"build": "npm run build:app && npm run build:lambda",
"build:app": "react-scripts build",
"build:lambda": "netlify-lambda build netlify/functions",
"test": "react-scripts test",
"eject": "react-scripts eject"
The only way I could get express to work was to build the express app using netlify-lambda - so it packages all dependencies in each file during the build process).
Are you saying this shouldn’t be necessary? If I just put express code in files within netlify/functions, when it’s deployed it’ll automatically build them and zip dependencies?
# example netlify.toml
command = "npm run build"
functions = "build-functions"
publish = "build"
## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
# from = "/*"
# to = "/index.html"
# status = 200
## (optional) Settings for Netlify Dev
# command = "yarn start" # Command to start your dev server
# port = 3000 # Port that the dev server will be listening on
# publish = "dist" # Folder with the static content for _redirect file
## more info on configuring this file: https://www.netlify.com/docs/netlify-toml-reference/