Coder Social home page Coder Social logo

figures's Introduction

Figures

This is a sinatra microservice for running PDFFigures2 fat jar. It will extract the images and returns JSON with the URIs of the extracted images.

The API provides three main functions:

  1. /process to extract figures from a given PDF URL
  2. an image server for the assets
  3. /cleanup to remove the assets

Developing

RACK_ENV=development bundle exec rackup -p 4567 starts the server.

Steps to use this

  1. Build the docker image docker build -t figures . and tag it: docker image tag figures dluan/figures:0.0.5

  2. Run the image to start the sinatra web host docker run -p 4567:4567 dluan/figures:0.0.5

Or if running on an external instance, forward port 80. docker run -t --init --rm -p 80:4567 dluan/figures:0.0.5

  1. Once it's running you can post to it like so:
curl localhost:4567/process -X POST -H "Content-Type: application/json" -d '{"pdf": "https://storage.googleapis.com/jellyposter-store/d5058c6990e36d68068ad98422372b6b.pdf", "upload_id": "1"}'

Deploying

This can be deployed on Heroku or GCE. It is also avilable as an image on docker hub: https://hub.docker.com/repository/docker/dluan/figures.

License

The jellypbc project is dual-licensed under Apache 2.0 and MIT terms.

figures's People

Contributors

dennyluan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar Cindy Wu avatar  avatar

Forkers

wj-amarantos

figures's Issues

Error while passing parameters to the "process" endpoint

Dear @dennyluan, dear @cindywu,

I am running the services on docker. When I am posting the following request, I am getting 422 response with message "Missing PDF url".

curl localhost:4567/process -X POST -H "Content-Type: application/json" -d '{"pdf": "https://storage.googleapis.com/jellyposter-store/d5058c6990e36d68068ad98422372b6b.pdf", "upload_id": "1"}'

my docker compose file looks like:

version: "3"

services:
pdffigures2:
image: dluan/figures:0.0.5
container_name: pdffigures2
build: .
ports:
- "4567:4567"
networks:
- pdffigures2_net
environment:
- RAILS_ENV=development
- RACK_ENV=development

networks:
pdffigures2_net:
driver: bridge

could someone please help me to fix this issue?

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.