jonathansilva / nano
Nano Framework PHP
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/jonathansilva/nano
Requires
- php: >= 8.4.0
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