Permalink
Browse files

shared database url

  • Loading branch information...
1 parent 8a00d19 commit 4c83da3de77ab9afdb9e84d5d930aaca2511c644 Joshua Stauter committed Apr 15, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −4 index.php
  2. +0 −1 phpinfo.php
View
@@ -5,13 +5,14 @@
class Todo extends ActiveRecord\Model { }
ActiveRecord\Config::initialize(function($cfg) {
- $cfg->set_connections(array('development' => 'mysql://root:@localhost/todos'));
+ //$cfg->set_connections(array('development' => 'mysql://root:@localhost/todos'));
+ $cfg->set_connections(array('development' => $_ENV['DATABASE_URL']));
});
$app = new Slim();
-$app->get('/todos', function() {
+$app->get('/json', function() {
echo json_encode(array_map(function($todo) { return $todo->attributes(); }, Todo::all()));
});
@@ -35,8 +36,6 @@ class Todo extends ActiveRecord\Model { }
});
$app->get('/', function() {
- print_r($_ENV);
- echo getenv('DATABASE_URL');
echo file_get_contents('index.html');
});
View
@@ -1 +0,0 @@
-<?php phpinfo();

0 comments on commit 4c83da3

Please sign in to comment.