atk4 / api

Implementation of RestAPI for Agile Data
https://agiletoolkit.org/
14 stars 12 forks source link

emitter is always defined and it should stop script execution after e… #2

Closed DarkSide666 closed 6 years ago

DarkSide666 commented 6 years ago

emitter is always defined and it should stop script execution after emitting otherwise it tries to match more services.

For example:

$restapi->get('/ping', function() {
   return 'Pong';
});

// here we authorize - check for token
$restapi->authorize();

if I request service /ping, then it also tries to authorize, but it should stop script execution as soon as /ping service is matched and response is emitted.