Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/namikazebadri/spring-boot-env-properties

Exploratory Project for Spring Boot Env & Properties
https://github.com/namikazebadri/spring-boot-env-properties

environment-variables properties spring-boot

Last synced: about 1 month ago
JSON representation

Exploratory Project for Spring Boot Env & Properties

Awesome Lists containing this project

README

        

# Spring Boot Env Properties

This project is an exploratory project where I demonstrated the use of environment variables and properties inside a spring project.
In this project you will find these:

1. The use of environment variable inside properties file
2. The use of environment variable inside properties file with default value
3. Getting environment variable from `Environment` class
4. Getting environment variable from `Environment` class with default value
5. Getting properties data through `ConfigurationProperties` annotated class
6. Map properties data through `@value` annotation

## Running this project

Set environment variables for:

```shell
export SERVICE_NAME=JustProps
```

Run Spring Boot:

```shell
./gradlew bootRun
```

## Author

[Unis Badri](https://unisbadri.com) ([email protected])