Git Product home page Git Product logo

http4s-circe-example's Introduction

http4s-circe-example

Example of http4s server with various endpoints

To run sbt run or you can use sbt-revolver with sbt ~reStart

Endpoints

http://localhost:8080/greet => json

http://localhost:8080/hello/{name} => text

http://localhost:8080/hello?name= => text

http://localhost:8080/literal => json

http://localhost:8080/gzip => lots of gzipped text

http://localhost:8080/mystream => an endless chunked stream

http://localhost:8080/fs/hello.txt => static text from classpath

http://localhost:8080/fs/form.html => HTML Form, which takes username and handles it via UrlForm

POST with some payload, you should get it back(use postman or similar)

http://localhost:8080/echo => Whatever you sent

http://localhost:8080/random => a random digit

http://localhost:8080/counter => incrementing digit (hacky)

http://localhost:8080/counter2 => incrementing digit (Better, with Ref)

http://localhost:8080/slow => sleeps for 4 seconds

(Client examples)

Calling our own endpoints

Talking to external web service https://jsonplaceholder.typicode.com/

Talking to OpenAI Dall-E

(To use it you'll have to fill in your OpenAI OPENAI_API_KEY in the Environment)

http4s-circe-example's People

Contributors

fancellu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sc6l6d3v

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.