All web apps need configuration files. Configuration files let you move things like database credentials, API keys, and which port to run the HTTP server on away from your source code and into a separate configuration file.
Your application will also run in at least three different environments: local development, automated testing, and production. Configuration files enable having different defaults in each environment, all checked into version control and easily reproducible.
You could get through the examples in ...