Nano Framework PHP

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

pkg:composer/jonathansilva/nano

v1.1.1 2025-11-30 22:06 UTC

This package is auto-updated.

Last update: 2025-11-30 22:23:38 UTC


README

Nano framework PHP para desenvolvimento de API's e aplicações Web

public/index.php

<?php

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

$app = Nano\Core\Router\Instance::create();

$app->use('App\Middleware\Token\Assert');

$app->notFound('App\Callback\Page\NotFound');

$app->get('/about', fn ($req, $res) => $res->view('about'));

$app->get('/hello/{name}', function ($req, $res): void {
    echo $req->params()->name;
});

$app->post('/api/register', function ($req, $res): void {
    $res->json(201, array('message' => 'Cadastrado com sucesso'));
});

$app->start();

Nano docs