GithubHelp home page GithubHelp logo

dbgjerez / spring-kotlin-crud Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 7 KB

API Example using Spring, Kotlin and MongoDB

Kotlin 100.00%
mongodb kotlin spring-kotlin-crud spring spring-mvc spring-boot spring-data-mongodb kotlin-language functional-programming gradle

spring-kotlin-crud's Introduction

spring-kotlin-crud

API Example using Spring, Kotlin and MongoDB

Usage

Build

$ gradle clean build

Run

$ java -jar build/libs/spring-kotlin-crud-*.jar

Test using HTTPie

POST

$ echo -n '{"title":"the Lord of the Ring"}' | http :8080/book
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8
Date: Fri, 21 Dec 2018 07:46:35 GMT
Transfer-Encoding: chunked

{
    "id": "5c1c9a5b7cc1a642a2c76c12",
    "title": "the Lord of the Ring"
}

PUT

$ echo -n '{"id":"5c1c9a5b7cc1a642a2c76c12","title":"The Lord of The Rings"}' | http PUT :8080/book/5c1c9a5b7cc1a642a2c76c12 
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8
Date: Fri, 21 Dec 2018 07:48:22 GMT
Transfer-Encoding: chunked

{
    "id": "5c1c9a5b7cc1a642a2c76c12",
    "title": "The Lord of The Rings"
}

GET

08:48 $ http :8080/book/5c1c9a5b7cc1a642a2c76c12
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8
Date: Fri, 21 Dec 2018 07:49:12 GMT
Transfer-Encoding: chunked
{
    "id": "5c1c9a5b7cc1a642a2c76c12",
    "title": "The Lord of The Rings"
}

DELETE

$ http DELETE :8080/book/5c1c9a5b7cc1a642a2c76c12
HTTP/1.1 200 
Content-Length: 0
Date: Fri, 21 Dec 2018 07:49:50 GMT

spring-kotlin-crud's People

Contributors

dbgjerez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.