firasrg / autocare-rest-api

AutoCare is a well-organized REST API sample app
GNU Affero General Public License v3.0
0 stars 2 forks source link

Improve server configuration #5

Open firasrg opened 1 month ago

firasrg commented 1 month ago

In line with the 12-factor methodology, which emphasizes strict separation of config in modern apps, we may need to configure server depending on the environment (or Spring profile(s)) like dev, production. This will not only help in managing different environments but also provide an opportunity to explore and understand how Spring Boot properties can be used effectively.

Create distinct configurations for each profile (check Spring Boot Profile-Specific Files).

Tasks :

  1. Manage server settings: port, connection timeout, keep-alive timeout, max threads etc...
  2. Keep common configs togeter in a separate properties file.
  3. Configure common database for production profile (e.g., MySQL, PostgreSQL).
  4. Configure SSL for production profile.

Note: it's possible to get self-signed certificate to enable SSL locally, check the guide.

Learning Goals :

nealgoogs commented 1 month ago

Worked on this. Should be the pull request. Let me know what I need to do to improve it.