Skip to content

Instantly share code, notes, and snippets.

@ridwanbejo
Created June 6, 2020 14:45
Show Gist options
  • Save ridwanbejo/43c22a8bcb8c27f5e1fd0990f3b8c4c2 to your computer and use it in GitHub Desktop.
Save ridwanbejo/43c22a8bcb8c27f5e1fd0990f3b8c4c2 to your computer and use it in GitHub Desktop.
laravel-queue-sqs - routes/web.php
<?php
/** @var \Laravel\Lumen\Routing\Router $router */
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
use App\Jobs\ExampleJob;
use App\Jobs\HelloWorldJob;
$router->get('/', function () use ($router) {
return $router->app->version();
});
$router->get('/test-queue', function () use ($router){
dispatch(new ExampleJob);
dispatch(new HelloWorldJob("Hello world dari Serverless ID!"));
return "ExampleJob dan HelloWorldJob sedang dijalankan!";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment