I’ve used the UI to put in a few environment variables and actually see them in the build as well. I’ve built a graphql/node server that uses a mongoose connection and have a front end hooked up on localhost. When I hardcode the uri string, the connection works as intended only to be stopped by another missing environment variable. I’ve read that the serverless functions should have no issues accessing the environment variables given in the UI. What gives?
https://mystifying-carson-b00552.netlify.com/.netlify/functions/graphql
"scripts": {
"build": "run-p build:**",
"start": "nodemon --exec babel-node src/lambda/graphql.js",
"test": "echo \"Error: no test specified\" && exit 1",
"start:lambda": "netlify-lambda serve src/lambda",
"build:lambda": "netlify-lambda build src/lambda"
}
netlify.toml
[build]
command = "npm run build" # the command you run to build this file
functions = "built-lambda" # netlify-lambda builds to this folder AND Netlify reads functions from