Skip to content

zetaops/document_render_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Document Template Render Service

Service simply takes two parameters, template file and template variables. It renders template and uploads it to any S3 compatible service.

Run Service

docker run \
    -e S3_PROXY_URL=""
    -e S3_ACCESS_KEY="access_key" \
    -e S3_SECRET_KEY="secret" \
    -e S3_PUBLIC_URL="http://localhost/" \
    -e S3_PROXY_PORT="80" \
    -e S3_BUCKET_NAME="my_bucket" \
    -e MAX_UPLOAD_TEMPLATE_SIZE=2097152 \
    -p 3002 \
    zetaops/document_render_service

Usage

Request:

# template from url
curl localhost:3002/v1 -X POST -i -H "Content-Type: application/json" -d '{"template": "http://example.com/sample_template.odt", "context": {"name": "ali"}}'

# base64 encoded template
curl localhost:3002/v1 -X POST -i -H "Content-Type: application/json" -d "{\"template\": \"`base64 -w 0 template.odt`\", \"context\": {\"name\": \"ali\"}}"

Response:

{"download_url": "http://example.com/sample_rendered.odt"}

Libraries used

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages