One rule
Secrets do not belong in code. Your API should read config from process.env, and each machine should provide its own values.
This protects things like database URLs, JWT secrets, API keys, ports, and production settings.
What counts as config
Config is anything that may change between your laptop, a teammate’s laptop, and deployment. For this Express API, PORT and NODE_ENV are enough to practise the pattern.
A secret is config that must not be public. Example: payment keys, email passwords, database passwords, and token signing secrets.