Skip to content

Blank App ​

Minimal Nexphant application — a single route that returns JSON.

Setup ​

bash
composer create-project nexphant/nexphant my-app --template blank
cd my-app

app.php ​

php
<?php

require __DIR__ . '/vendor/autoload.php';

use Nexphant\App;
use Nexphant\Request;

$app = App::create();

$app->get('/', fn (Request $request) => [
    'name' => 'Nexphant',
    'status' => 'running',
]);

$app->listen(port: 8080);

Run ​

bash
php app.php

Test ​

bash
curl http://localhost:8080
# {"name":"Nexphant","status":"running"}

Dev Reload ​

bash
composer run dev

Changes to app.php will trigger automatic restart.

Released under the MIT License.