https://github.com/landlockedboat/weatherboy
weather forecasting for the soul ☀️
https://github.com/landlockedboat/weatherboy
Last synced: 3 months ago
JSON representation
weather forecasting for the soul ☀️
- Host: GitHub
- URL: https://github.com/landlockedboat/weatherboy
- Owner: landlockedboat
- Created: 2018-11-16T09:53:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T16:31:04.000Z (over 6 years ago)
- Last Synced: 2025-01-08T08:46:51.222Z (4 months ago)
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# weatherboy
> weather for the soul :sunny:Small Java 8 app built for [LTS beratung](https://angel.co/lts-beratung-1)'s job application.
## Installation
`docker pull vikepic/weatherboy`
Run it with:
`docker run -p 8080:8080 -t vikepic/weatherboy`
## Usage
```
> curl localhost:8080
{"hello":"world"}// Get the weather of Barcelona
> curl localhost:8080/weather
{"condition":"broken clouds","temperature":15.5}// Get the weather of London
> curl localhost:8080/weather/London
{"condition":"few clouds","temperature":10.89}
```## Documentation
You can access the API documentation by accessing to `http://localhost:8080/swagger-ui.html`.
The docs are also available in json format. You can get them by executing `curl localhost:8080/v2/api-docs`.
## Problem statement
1. Create a small application with Java (8 or above), that starts up a webserver with an API that listens to GET /weather/
The server makes a JaxRS/Jersey connection to https://openweathermap.org/current (free account possible), gives it the city, gets a response and parses the weather description into a response JSON like
```
{
condition: Light intensity drizzle,
temperature: 20.0
}
```This JSON is sent to our caller.
2. Put it into a Docker container via Dockerfile. I do not need to know what happens inside the container, it just should make your API listen to 8080 when started.
3. Provide me a link `` to the Docker Registry / Container (docker.io?) so that I can download your docker container
4. I (I) should be able to do the following in my bash shell:
`docker start -o 8080:8080 `
```
curl https://localhost:8080{
hello: world
}
```That is, I should be able to download it, start it, portforward the 8080 and do a curl to see the JSON you created.
5. Create an OpenAPI documentation for your API (OpenAPI 3) and check it in
6. Send me a link to the git source code of the entire project.