Skip to content
/ p2jsvc Public

A RESTful web service adaptor for pdf2json, built with restify and nodejs.

License

Notifications You must be signed in to change notification settings

modesty/p2jsvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p2jsvc

A RESTful web service adaptor for pdf2json, built with restify and nodejs.

##Installation

            git clone https://github.com/modesty/p2jsvc
            cd p2jsvc
            npm install

##Start the Server

            cd p2jsvc
            node index

You should see '[time_stamp] - PDFFORMServer1 listening at http://0.0.0.0:8001' in termial window.

##Service Status Check

            curl -isv http://0.0.0.0:8001/p2jsvc/status

Response should include something like this:

            {"status":{"code":200,"message":"OK","fieldName":"PDFFORMServer1"}}

##Test with GET

            curl -isv http://0.0.0.0:8001/p2jsvc/data/xfa_1040ez
            curl -isv http://0.0.0.0:8001/p2jsvc/data/xfa_1040a
            curl -isv http://0.0.0.0:8001/p2jsvc/data/xfa_1040

##Test with POST

            curl -isv -H "Content-Type: application/json" -X POST -d '{"folderName":"data", "pdfId":"xfa_1040ez"}' http://0.0.0.0:8001/p2jsvc
            curl -isv -H "Content-Type: application/json" -X POST -d '{"folderName":"data", "pdfId":"xfa_1040a"}' http://0.0.0.0:8001/p2jsvc
            curl -isv -H "Content-Type: application/json" -X POST -d '{"folderName":"data", "pdfId":"xfa_1040"}' http://0.0.0.0:8001/p2jsvc

##Concurrency Benchmark Test

            ab -n 10 -c 10 http://0.0.0.0:8001/p2jsvc/data/xfa_1040ez
            ab -n 10 -c 10 http://0.0.0.0:8001/p2jsvc/data/xfa_1040a
            ab -n 10 -c 10 http://0.0.0.0:8001/p2jsvc/data/xfa_1040

##More Info

Restful Web Service for PDF2JSON

About

A RESTful web service adaptor for pdf2json, built with restify and nodejs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published