mongo-image-server

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

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 14 Imported by: 0

README

MongoDB Image Server

An image server based mongodb gridfs.

Installation

$ go get github.com/alsey/mongo-image-server

Connfiguration

Use envionment variables to config this server.

  • PORT0 : port, default is 3000
  • MONGO_ADDR : mongodb address, default is 127.0.0.1:27017
  • MONGO_DB : mongodb database name
  • MONGO_USER : mongodb authenticate user
  • MONGO_PASS : the user's password

How to Use

  1. While some image files saved at mongodb with gridfs format, you can access this images by URL with this server.

The URL is

http://<host>:<port>/images/<filename>
  1. You can change image size by url query parameters while access the image file.
http://<host>:<port>/images/<filename>?w=<width>&h=<height>

The url variables w and h is image's width and height, in pixels.

  1. I wrote a Dockerfile for you, you can make a Docker image, and put it in Kubernetes or Mesos.
$ docker build -t 'mongo-image-server' .
  1. The server includes a health check endpoint for microservice scenario.
http://<host>:<port>/health
http://<host>:<port>/env

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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