PHP Classes

File: routes/web.php

Recommend this page to a friend!
  Classes of Cauê Santana   URL Shortener API   routes/web.php   Download  
File: routes/web.php
Role: Example script
Content type: text/plain
Description: Example script
Class: URL Shortener API
API to create and access short URLs
Author: By
Last change:
Date: 6 hours ago
Size: 834 bytes
 

Contents

Class file image Download
<?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.
|
*/

/**
 * Redirect to original url.
 */

$router->get('/{hash}', 'UrlManagement\RedirectController');


/**
 * Group `/short`.
 *
 * Contains routes to create short url
 * And to get url info.
 */

$router->group(['prefix' => 'short'], function () use ($router) {
   
$router->post('/', 'UrlManagement\CreateUrlController');
   
$router->get('/{hash}', 'UrlManagement\GetUrlInfoController');
});