Skip to content

rafaeljesus/gridfs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GridFS API

Codeship Status for rafaeljesus/gridfs-api Docker Image Pulls NPM version bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code

js-standard-style

  • Exposes a REST API for MongoDB GridFS

Installation

npm install -g gridfs-api

Running server

To run a suite tests execute:

npm run build && npm run serve

API Documentation

create

curl -i -X POST 'http://localhost:3000/v1/files' \
 -F 'name=foo' \
 -F 'type=application/pdf' \
 -F 'metadata[userId]=1' \
 -F 'image=@/home/username/file.pdf'

show

curl -X GET 'http://localhost:3000/v1/files/1'

check-exists

curl -X GET 'http://localhost:3000/v1/files/1/check-exists'

delete

curl -X DELETE 'http://localhost:3000/v1/files/1'

Built with

  • nodejs Backend is a node-v.5.7.1.
  • koa API is a KOA app. It respond to requests RESTfully in JSON.
  • Mongodb Mongodb as a data store.

Docker

This repository has automated image builds on hub.docker.com.

Use docker-mongodb and run command described there

Finally run:

$ docker-machine start default
$ eval $(docker-machine env default)
$ docker run -it -e "NODE_ENV=development" -v "$(pwd)":/data --link mongo:mongo -w /data -p 3000:3000 rafaeljesus/gridfs-api
$ curl `docker-machine ip default`:3000

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Maintaners

About

Exposes a REST API for MongoDB GridFS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published