dataurltopng

command module
v0.0.0-...-bc8bb04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2014 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dmachat/dataurltopng

dataurltopng provides a service to convert base64 encoded png strings from html5 dataurl attributes into real png files

Installation

Create an upstart task for the server:

# Upstart Configuration

description     "Dataurl to PNG service"

start on (net-device-up
          and local-filesystems
          and runlevel [2345])

stop on runlevel [016]

respawn

exec /usr/local/go/bin/dataurltopng 

Usage

Compile the binary and run on your server, optionally using a Config.gcfg file to overwrite basic auth and image path values.

POST requests should look like

{
  Sitename: "sitename",
  Dataurl: "data:image/png;base64,..."
}

Configuration

You can add a go config file -- Config.gcfg -- in the directory with the go binary to set environment variables like port, authentication information and images directory:

[server]
port = "9000"
imagedir = "/usr/local/images"
username = "data"
password = "topng"

You'll get back a json object with a success and filepath property.

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址