Git Product home page Git Product logo

weather's Introduction

Weather

CI

Reference Project weather-rpc,It based on Scala 2 and cats 1, and does not use fs2-grpc and sangria

Description

A web server that allows to get the current temperature at most of the big cities in the world.

Technology stack

  • Scala 3
  • cats-effect 3
  • fs2-grpc
  • http4s
  • circe
  • sangria

Running

  • You need to run the server app. Go to the project dir and execute
sbt "weather-server/runMain bitlap.weather.server.WeatherApplication"

Client apps

There are 2 clients in the project:

  1. a simple client that gets the temperature for a single city and sends a shutdown server command
  2. a streaming client that gets the temperature for multiple cities in a stream mode. This client does not stop the server.

To run the simple client execute

sbt "weather-client/runMain bitlap.weather.client.SimpleWeatherClient"

To run the streaming client execute

sbt "weather-client/runMain bitlap.weather.client.StreamingWeatherClient"

http4s http

curl --location 'http://localhost:8888/weather' \
--header 'Content-Type: application/json' \
--data '{
    "name": "Beijing",
    "countryCode": "CN",
    "region": "Beijing"
}'

sangria graphql

curl --location 'http://localhost:8888/graphql' \
--header 'Content-Type: application/json' \
--data '{"query":"query test {\n    city(name:\"Beijing\",countryCode:\"CN\"){\n     value\n    }\n}","variables":{}}'

weather's People

Contributors

jxnu-liguobin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.