Socket
Book a DemoInstallSign in
Socket

nutheory_rack

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nutheory_rack

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Rack::GridFS

Rack:GridFS is a Rack middleware for creating HTTP endpoints for files stored in MongoDB's GridFS. You can configure a prefix string which will be used to match the path of a request and create an id for looking up the file in the GridFS store.

For example,

GET '/gridfs/someobjectid'

If the prefix is "gridfs", then the key will be be "someobjectid".

== Installation

gem install jnunemaker--rack-gridfs

== Usage

require 'rack/gridfs' use Rack::GridFS, :hostname => 'localhost', :port => 27017, :database => 'test', :prefix => 'gridfs'

You must specify MongoDB database details:

  • hostname: the hostname/IP where the MongoDB server is running. Default 'localhost'.
  • port: the port of the MongoDB server. Default 27017.
  • database: the MongoDB database to connect to.
  • prefix: a string used to match against incoming paths and route to through the middleware. Default 'gridfs'.

== Sinatra Example

require 'rubygems' require 'sinatra'

require 'rack/gridfs' use Rack::GridFS, :hostname => 'localhost', :port => 27017, :database => 'test', :prefix => 'gridfs'

put a file in gridfs and try visiting /gridfs/objectid

get /.*/ do "Whatchya talking about?" end

== Copyright

Copyright (c) 2009 Blake Carlson. See LICENSE for details.

FAQs

Package last updated on 07 Apr 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.