Hi,
I’ve been hosting for an e-commerce startup project and building the whole app with Netilfy. I really like Netlify’s simplicity
As a matter of fact, I’m actually an entry full-stack dev and facing a lot of challenges these days as we integrating apollo graphql.
So here is one of the challenges:
I’m not sure if this is the right way of building multiple lambda functions. (have two functions: product, gateway each has its own folder and package.json
)
"scripts": {
"start": "run-p start:**",
"start:app": "react-scripts start",
"start:lambda-product": "netlify-lambda serve src/functions/products -p 9001",
"start:lambda-gateway": "netlify-lambda serve src/functions/gateway",
"build": "run-p build:**",
"build:app": "react-scripts build",
"build:lambda-product": "netlify-lambda build src/functions/products",
"build:lambda-gateway": "netlify-lambda build src/functions/gateway",
"test": "react-scripts test",
"debug": "react-scripts --inspect-brk test --runInBand --no-cache",
"eject": "react-scripts eject",
"dev": "node --inspect ./node_modules/.bin/netlify dev"
},
This setup anyhow builds and serves both functions(had to add -p
since netlify lambda
doesn’t’ automatically serve multiple functions in different port)
Is there a way to build in on script like build:lambda: "netlify-lambda build
without building each function?
Also, I assume that when it’s actually being deployed Netlify doesn’t use my serve script but uses it’s own proxying. Is that correct?