Switch branches/tags
Nothing to show
Find file History
Latest commit ece8292 Mar 7, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.mvn/wrapper Add REST DSL project Mar 7, 2018
src Add REST DSL project Mar 7, 2018
.gitignore Add REST DSL project Mar 7, 2018
README.md Add REST DSL project Mar 7, 2018
mvnw Add REST DSL project Mar 7, 2018
mvnw.cmd Add REST DSL project Mar 7, 2018
pom.xml Add REST DSL project Mar 7, 2018

README.md

rest-dsl

Demos a simple REST service in Apache Camel using the REST DSL.

This is a Spring Boot application. It uses Camel's restlet component to provide the REST service, which runs on localhost, port 8080.

There is:

  • A single GET operation which returns the string "Hello, world!"
  • A single POST operation which takes a name in a JSON object, and then returns that name in the output.

To run the app:

mvn clean spring-boot:run

Then, to test the REST service's GET operation:

$ curl http://localhost:8080/api/
"Hello, world!"

And to test the REST service's POST operation:

$ curl --request POST \
    --data "{ \"name\": \"Jeff Mills\" }" \
    --header "Content-Type: application/json"
    http://localhost:8080/api/
"Thanks for your post, Jeff Mills!"