Quick question! our dynamodb is not referenced in ...
# help
s
Quick question! our dynamodb is not referenced in config. So how does it connect with our frontend? Is it through the serverless.yml file? If so, why do we connect through serverless.yml when everything else connects through config.js? Thanks so much 🙂
f
Hi @steve gates, the frontend makes api calls to the backend. The request is handled by the Lambda functions. The Lambda functions talks to the DynamoDB tables.
s
Hey @Frank! Thanks for your response. I get that. I'm asking more about the setup. in config.js, we don't mention the dynamodb information and im wondering why not. https://github.com/AnomalyInnovations/serverless-stack-demo-client/blob/master/src/config.js
f
This config is for the frontend. Lambda knows the table name, it’s stored in its environment variable most likely.
s
It seems to be stored in the serverless.yml file. My question is, design-wise, why did the team choose to put all infra info in config, but left dynamodb out by itself in serverless.yml? @Frank
Thanks for your quick responses btw -- learnign a lot thanks to all of this!
f
config.js
is ur React app config. It only contains the information of the Api and authentication endpoints that the React app needs to connect to. Since it doesn’t talk to DynamoDB directly, it doesn’t need to know the table names.