count = 4; // process count $api->any('/', function ($requst) { $filename = "wifi.png"; $headers = []; if (file_exists($filename)) { $headers[] = "Cache-Control: public"; $headers[] = "Content-Type: image/png"; $headers[] = "Content-Transfer-Encoding: Binary"; $headers[] = "Content-Length:".filesize($filename); $headers[] = "Content-Disposition: attachment; filename={$filename}"; die(); } else { die("Error: File not found."); } return new Response(200, $headers, $filename); }); $api->get('/hello/{name}', function ($requst, $name) { return "Hello $name"; }); $api->post('/user/create', function ($requst) { return json_encode(['code'=>0 ,'message' => 'ok']); }); $api->start();