<?php use NoahBuscher\Macaw\Macaw; Macaw::get('/', function () { echo 'Hello world!'; }); Macaw::post('/', function () { echo 'I <3 POST commands!'; }); Macaw::error(function () { echo '404 :: Not Found'; }); Macaw::get('/test', 'TestController@index'); Macaw::dispatch();
public function run($baseNamespace = null) { if ($this->runningInConsole()) { return $this->runCall($baseNamespace); } else { require static::$data_root . '/conf/routes.php'; Route::error(function () use($baseNamespace) { return $this->runCall($baseNamespace); }); Route::dispatch(); //return $this->runCall($baseNamespace); } }