one return to much

master
Tezza 2015-03-01 14:56:11 +01:00
parent a4825200a4
commit 32af9ccf65
1 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,10 @@
) )
); );
$app->register( new Silex\Provider\DoctrineServiceProvider(),
array( $app[ 'db.options' ] )
);
// Add header to allow access from everywhere // Add header to allow access from everywhere
$app->after( function ( Request $request, Response $response ) { $app->after( function ( Request $request, Response $response ) {
$response->headers->set( 'Access-Control-Allow-Origin', '*' ); $response->headers->set( 'Access-Control-Allow-Origin', '*' );
@ -32,7 +36,6 @@
$app->error(function (\Exception $e, $code) use ( $app ) { $app->error(function (\Exception $e, $code) use ( $app ) {
if ( $code == 404 ) { if ( $code == 404 ) {
return $app->redirect('/'); return $app->redirect('/');
return new Response($message);
} }
}); });