Socket
Book a DemoInstallSign in
Socket

sinatra-mongo-config

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinatra-mongo-config

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Sinatra-Mongo-Config

A simple wrapper for instantiating a MongoDB connection in Sinatra

Installing

gem install sinatra-mongo-config

Usage

Set some properties so that a connection can be made to your MongoDB database. You then have access to a database object which represents your MongoDB database.

The complete list of parameters is:

:mongo_db
:mongo_host
:mongo_port
:mongo_user
:mongo_password

The only property you really need to set is mongo_db, everything else has sensible defaults for development.

Example

configure do
	  set :mongo_db, 'ethangunderson'
	end

	configure :production do
	  set :mongo_host, 'flame.local.mongohq.com'
	  set :mongo_user, 'foo'
	  set :mongo_password, 'bar'
	end
	
	get '/blog' do
		@posts = database['posts'].find()
		haml :blog
	end

FAQs

Package last updated on 06 May 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.