File: /home/mmickelson/w2p.spidev.xyz/routes/web.php
<?php
/*
|--------------------------------------------------------------------------
| 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.
|
*/
$router->get('/', function () use ($router) {
return $router->app->version();
});
// $router->get('/{foo}hello', function () use ($router) {
// return "hello ".$foo;
// });
$router->get('user/{id}', function ($id) {
return 'User '.$id;
});
$router->get('/{imagename}.png', 'ExampleController@customize');
// $router->get('/{imagename}.png', function ($imagename) use ($router) {
// // return $imagename;
// $image = file_get_contents('https://ibalancer.silcn.co/creatives/e3b34cd0-5ab8-11e8-905f-a54196d37af8.png');
// file_put_contents('./'.$imagename.'.png', $image); //Where to save the image on your server
// $size = filesize('./'.$imagename.'.png');
// return response($image)
// ->header('Content-Type','image/png')
// ->header('Content-Length', $size)
// ->header('Cache-Control','max-age=60, must-revalidate');
// return $router->app->version();
// });