项目作者: knoma

项目描述 :
Simple REST Webservice using Dropwizard and Cassandra Driver
高级语言: Java
项目地址: git://github.com/knoma/cass-dropwizard.git
创建时间: 2019-10-20T02:19:18Z
项目社区:https://github.com/knoma/cass-dropwizard

开源协议:

下载


Build Status

REST Webservice using Dropwizard and Cassandra

Simple REST Webservice using Dropwizard 4.0 beta and Cassandra Driver 4.15

Requirements

  • Cassandra
  • Java 11
  • Curl

Apply keyspace and table from cql folder.
```shell script
./cqlsh -f src/main/resources/cql/db.cql

  1. Build app via gradle
  2. ```shell script
  3. ./gradlew clean build

Start service via the fat jar
```shell script
java -jar build/libs/cass-dropwizard-all.jar server config.yml

  1. Check health of the service
  2. ```shell script
  3. curl http://localhost:9000/health-check

Create data via curl
```shell script
curl -v -XPOST “localhost:9000/person” -H “Content-Type: application/json” -d ‘{“id”: “66992983-af17-43ad-9fc9-b9a654a42d36”, “firstName”: “how”, “lastName”: “Ilove”, “email”: “jss@test.de”}’

  1. Query single person
  2. ```shell script
  3. curl -v "localhost:9000/person/66992983-af17-43ad-9fc9-b9a654a42d36"

Query all persons
```shell script
curl -v “localhost:9000/person/all”

  1. Query count
  2. ```shell script
  3. curl -v "localhost:9000/person/count"

DELETE data
shell script curl -v -XDELETE "localhost:9000/person/66992983-af17-43ad-9fc9-b9a654a42d36"