Giter Site home page Giter Site logo

requestinfo's Introduction

Requestinfo

I’ve written webapps that just print out the HTTP request headers long ago, but usually lately I’ve been working with Apache fronted Tomcat instances where Apache had mod_php installed, so I could just use the php:

<pre><? print_r($_SERVER); ?></pre>

And when I’m trying to see HTTP headers from the client, I can just use Firefox’s LiveHttpHeaders plugin.

However, I wanted to verify that certain headers were actually coming into Tomcat (after going through something that in turn went through Apache to get to Tomcat).

This app is heavily based on sinatra-example: git://github.com/vertis/sinatra-example.git. I mostly used the instructions found here: www.coreguardian.org/2010/02/21/sinatra-on-java/. I was too lazy to setup a Sinatra app from scratch for this, and the file layout and cucumber test in the vertis sinatra-example was clean.

Setup

Requires jruby (I used 1.4.0). jruby.org/

In addition I did this to get all the jars needed:

jruby -S gem install sinatra warbler haml cucumber webrat

Test

Optionally you can test with:

jruby -S rake
jruby -S rake spec

Build

then to build war with same name as directory use:

jruby -S warble

Deployment and Usage

Deploy the war by copying into webapps directory in Tomcat (assuming you have it configured to automatically deploy).

Then hit that webapp (for example: yourserver/requestinfo/ ) and see the result of request.inspect.

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.