Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b9d46d1

Browse files
more changes
1 parent 079b88a commit b9d46d1

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

‎README.md‎

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
## info
66
This is an example of doing reactive MicroServices using spring 5 functional web framework and spring boot 2.
77

8-
This service provide and API that will greet the user with a quote.
9-
8+
This service provide and API that will get the geo location and the sunrise and sunset times from an address.
9+
10+
```Gherkin
11+
Scenario Get Location
12+
Given I've an address
13+
When I call the location service
14+
Then I should get a geo location
15+
And I should get the sunrise and sunset times
16+
```
1017
This example cover several topics:
1118

1219
- Functional programing.
@@ -34,17 +41,30 @@ $ mvnw spring-boot:run
3441

3542
## Sample requests
3643

37-
- GET [http://localhost:8080/api/greetings](http://localhost:8080/greetings)
44+
Get from address
45+
```shell
46+
$ curl -X GET "http://localhost:8080/api/location/Trafalgar%20Square%2C%20London%2C%20England" -H "accept: application/json"
47+
```
3848

39-
- GET [http://localhost:8080/api/greetings/reactive](http://localhost:8080/greetings/reactive)
49+
Post from JSON
50+
```shell
51+
$ curl -X POST "http://localhost:8080/api/location" -H "accept: application/json" -H "content-type: application/json" -d "{ \"address\": \"Trafalgar Square, London, England\"}"
52+
```
4053

41-
- POST [http://localhost:8080/api/greetings](http://localhost:8080/greetings)
54+
Both will produce something like:
55+
```json
56+
{
57+
"geographicCoordinates": {
58+
"latitude": 51.508039,
59+
"longitude": -0.128069
60+
},
61+
"sunriseSunset": {
62+
"sunrise": "2017年05月21日T03:59:08+00:00",
63+
"sunset": "2017年05月21日T19:55:11+00:00"
64+
}
65+
}
66+
```
4267

43-
```json
44-
{
45-
"name" : "json"
46-
}
47-
```
4868
## API
4969
[![View in the embedded Swagger UI](https://avatars0.githubusercontent.com/u/7658037?v=3&s=20) View in the embedded Swagger UI](http://localhost:8080/index.html)
5070

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /