Last active
October 21, 2015 18:48
-
-
Save lduboeuf/25c6979dbb814acf5870 to your computer and use it in GitHub Desktop.
hello world with Silex, use of json_encode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use Symfony\Component\HttpFoundation\Response; | |
$app = new Silex\Application(); | |
$app['debug'] = true; | |
$app->get('/', function(){ | |
return new Response(json_encode("Hello world"), 200, array( 'Content-Type' => 'application/json' )); | |
//return json_encode("Hello world"); | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment