This is a simple example of migrating a war based webapp to spring-boot
This demonstrates
- Setting up a jersey resource config with filters and resources.
- Dependency injection using simple repository objects.
./gradlew bootRun
$ curl -i -H "X_USER_ID: Carol" http://localhost:8080/external/resource
HTTP/1.1 200
Content-Type: application/json
Content-Length: 10
Date: Mon, 26 Dec 2016 10:43:40 GMT
Looks good
$ curl -i -H "X_USER_ID: Somebody" http://localhost:8080/external/resource
HTTP/1.1 401
Content-Length: 15
Date: Mon, 26 Dec 2016 10:45:51 GMT
Not authorized!%
$ curl -i -H "X_USER_ID: Carol" http://localhost:8080/internal/resource/illegal
HTTP/1.1 500
Content-Type: text/plain
Content-Length: 5
Date: Mon, 26 Dec 2016 10:46:31 GMT
Connection: close
This request also demonstrates the use of an injected repository object
$ curl -i -H "X_USER_ID: Somebody" http://localhost:8080/external/noauth
HTTP/1.1 200
Content-Type: application/json
Content-Length: 15
Date: Mon, 26 Dec 2016 10:47:56 GMT
["Some","data"]%