Permalink
Browse files

Commit

  • Loading branch information...
1 parent 2273602 commit 152e54cf06e76794306a27e4ee4665dc3cacf10e @khoanguyen committed Feb 21, 2012
Showing with 0 additions and 89 deletions.
  1. +0 −78 config/db.rb
  2. +0 −11 config/routes.rb
View
@@ -1,78 +0,0 @@
-require 'mongo'
-App.dbs = Apolon::DynamicObject.new
-
-def connect_to_mongo(config)
- connection = Mongo::Connection.new(config[:host], config[:port], config[:opts])
- database = connection.db(config[:database])
- database.authenticate(config[:user], config[:password], true) if config.has_key?(:user) && config.has_key?(:password)
- database
-end
-
-security_config = {
-
-}
-
-data_config = {
-
-}
-
-case App.env
-when 'development'
- security_config = {
- host:'localhost',
- port:27017,
- database:'eid_security_dev',
- opts:{
-
- }
- }
-
- data_config = {
- host:'localhost',
- port:27017,
- database:'eid_data_dev',
- opts:{
-
- }
- }
-
-when 'test'
- security_config = {
- host:'localhost',
- port:27017,
- database:'eid_security_test',
- opts:{
-
- }
- }
-
- data_config = {
- host:'localhost',
- port:27017,
- database:'eid_data_test',
- opts:{
-
- }
- }
-when 'production'
- security_config = {
- host:'localhost',
- port:27017,
- database:'eid_security',
- opts:{
-
- }
- }
-
- data_config = {
- host:'localhost',
- port:27017,
- database:'eid_data',
- opts:{
-
- }
- }
-end
-
-App.dbs.security = connect_to_mongo(security_config)
-App.dbs.data = connect_to_mongo(data_config)
View
@@ -1,11 +0,0 @@
-Routes = Rack::Builder.new do
- # Middlewares
- use Rack::CommonLogger
- # use Apolon::JsonMiddleware
-
- map('/') { run Rack::File.new('public/404.html') }
-
- # Mapping
- map('/auth') { run AuthenticationService }
- map('/users') { run UsersService }
-end

0 comments on commit 152e54c

Please sign in to comment.