01/10
2015
dev-master
9999999-dev
MIT
The Requires
by Ricky Su
Fast, async I/O web framework for php, (*1)
Example, (*2)
app.php, (*3)
<?php use WebUtil\Http\Request\ServerRequest; $app = new Respond\App\WebApp(); return $app->listen('0.0.0.0', 8080) ->get('/{id:\\d+}', function(ServerRequest $request){ return "match id with {$request->getAttribute('id')}"; }) ->post('/{id:\\d+}.html', function(ServerRequest $request){ return "match id.html {$request->getAttribute('id')}"; }) ->request(['GET', 'POST'], '/{id:\\d+}-{id2:\\d+}.html', function(ServerRequest $request){ return $request->getAttribute('id'); }) ->defaultRequest(function(ServerRequest $request){ return 'default'; });
Execute, (*4)
bin/respond app.php
MIT