Giter VIP home page Giter VIP logo

request-dumper's Introduction

request-dumper

It dumps request info using sinatra.

How to build

Rack

bundle install
bundle exec rackup config.ru -o 0.0.0.0

It was listened to 9292 port on your server.

Docker

docker build -f Dockerfile -t kakakikikeke/request-dumper ./
docker run -p 8080:8080 -d kakakikikeke/request-dumper

Heroku

Deploy this app into your heroku account.

Deploy

Heroku Container Registry

heroku container:login
heroku create -a test-app-20181002
docker build -f Dockerfile-for-heroku-container -t registry.heroku.com/test-app-20181002/web .
docker push registry.heroku.com/test-app-20181002/web
heroku container:release web
heroku open -a test-app-20181002

Google App Engine

git clone https://github.com/kakakikikeke/request-dumper.git
cd request-dumper
gcloud app deploy

k8s

Artifact HUB

helm repo add request-dumper http://kakakikikeke.github.io/request-dumper/
helm repo update
helm search repo request-dumper
helm install request-dumper request-dumper/request-dumper

How to use

For starting a process on local machine.

  • GET
curl -X GET \
  http://hostname:9292/test?hoge=fuga

You get the below json response.

{
    "body": "\"\"",
    "params": "{\"hoge\":\"fuga\",\"splat\":[\"test\"],\"captures\":[\"test\"]}",
    "path_info": "/test",
    "method": "GET",
    "query_string": "hoge=fuga",
    "content_length": null,
    "media_type": null,
    "form_data": false
}
  • POST
curl -X POST \
  http://hostname:9292/test \
  -d '{"hoge":"fuga"}' \
  -H "Content-Type: application/json"

You get the below json response.

{
    "body": "{\"hoge\":\"fuga\"}",
    "params": "{\"splat\":[\"test\"],\"captures\":[\"test\"]}",
    "path_info": "/test",
    "method": "POST",
    "query_string": "",
    "content_length": "15",
    "media_type": "application/json",
    "form_data": false
}
  • Bonus

You can show the app metrics for prometheus.

curl -X GET \
  http://hostname:9292/metrics

Version

  • Ruby 3.0.0
  • Gem 2.4.6
  • Other libraries version confirm to Gemfile

request-dumper's People

Contributors

dependabot[bot] avatar kakakikikeke avatar

Watchers

 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.