This is my first time using flightphp so be nice with me, I have tried everything and still not working so here we go...
I have this basic code in PHP using the micro-framework flightphp to create an API, in this specific case is just the method GET:
<?php
require 'flight/Flight.php';
Flight::register('db', 'PDO', array('mysql:host=localhost;dbname=api','root',''));
Flight::route('GET /personas', function () {
$sentence = Flight::db()->prepare("SELECT * FROM `persons`");
$sentence->execute();
$data = $sentence->fetchAll(PDO::FETCH_ASSOC);
Flight::json($data);
});
Flight::start();
?>
In the browser is showing me this:
WHen I use my Rest API Client simulator (postman, insomnia, etc) It shows it correctly
How can I fix it to show it correctly in the browser???