based in the parameters defined in the configuration file $di->set('db', function() use ($config) { return new Database(array( "host" => $config->database->host, "username" => $config->database->username, "password" => $config->database->password, "dbname" => $config->database->name )); }); // Registering an autoloader $loader = new Loader(); $loader->registerDirs( array( $config->application->modelsDir ) )->register();
function () use ($app) { }); // Retrieves robots based on primary key $app->get('/api/robots/{id:[0-9]+}', function ($id) use ($app) { }); // Adds a new robot $app->post(('/api/robots', function () use ($app) { }); // Updates robots based on primary key $app->put('/api/robots/{id:[0-9]+}', function ($id) use ($app) { }); // Deletes robots based on primary key $app->delete('/api/robots/{id:[0-9]+}', function ($id) use ($app) { }); $app->handle();