Skip to content
A image service with MongoDB GridFS backend.
Branch: master
Clone or download
Latest commit d654ff7 Nov 21, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
config first release Nov 21, 2017
health first release Nov 21, 2017
logger first release Nov 21, 2017
.gitignore first release Nov 21, 2017
Dockerfile first release Nov 21, 2017
LICENSE Initial commit Nov 21, 2017 first release Nov 21, 2017
main.go first release Nov 21, 2017

MongoDB Image Server

An image server based mongodb gridfs.


$ go get


Use envionment variables to config this server.

  • PORT0 : port, default is 3000
  • MONGO_ADDR : mongodb address, default is
  • 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

  1. You can change image size by url query parameters while access the image file.

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.



You can’t perform that action at this time.