GithubHelp home page GithubHelp logo

nevskrem / spring-echo-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raonigabriel/spring-echo-example

0.0 0.0 0.0 159 KB

A small app that echoes back a nice JSON with some info from the incoming requests

License: Apache License 2.0

Java 34.17% Shell 57.71% Groovy 8.13%

spring-echo-example's Introduction

Spring Boot Echo Example

A small app that echoes back a nice JSON with some info from the incoming requests:

  • Request protocol
  • Request method
  • Request headers
  • Request cookies
  • Request params (query string)
  • Request path
  • Request body (Base64 encoded)

Is is usefull to trace/debug problems while developing REST APIs and SOAP WebServices.

Features:

  1. Spring Boot 1.3.7, supporting fully executable JARs for Linux based operating systems, including “service” support
  2. Accepts HTTP methods: GET, POST, PUT, DELETE and OPTIONS
  3. Accepts all content type (*/*)
  4. Catches everything (ie, mapped at /**), thus no webjars, no favicon.ico and no /error
  5. Response code is always a 404 "Not Found" to avoid unexpected client behavior
  6. GZip compression is disabled (on purpose) to avoid unexpected client behavior
  7. Response content type is always "application/json;charset=UTF-8".
  8. Only 1 class, about 50 lines of code!!!
  9. Small. Final JAR includes everything (it self-contained) and it is only 12 MB

To get the code:

Clone the repository:

$ git clone https://github.com/raonigabriel/spring-echo-example.git

If this is your first time using Github, review http://help.github.com to learn the basics.

To run the application:

From the command line with Maven:

$ cd spring-echo-example
$ mvn spring-boot:run 

From the command line with Linux (eXecutable Jar):

$ cd spring-echo-example/target
$ ./spring-echo-example-1.0.0.jar

From the command line with Windows:

$ cd spring-echo-example/target
$ java -jar spring-echo-example-1.0.0.jar

From the command line with Mac:

$ echo 'Do yourself a favor and get LinuxMint!'

Try it using your browser, REST client, SoapUI, with:

Use your preferred IDE such as SpringSource Tool Suite (STS) or IDEA:

  • Import spring-echo-example as a Maven Project

License

Released under the Apache 2.0 license

spring-echo-example's People

Contributors

fabianlee avatar nevskrem avatar raonigabriel 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.