<?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.
|
*/

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', [
    'namespace' => 'App\Http\Controllers'
], function ($api) {

    //百度编辑器
    $api->get('ueupload', 'UeditorController@index');
    $api->post('ueupload', 'UeditorController@index');

    //前台
    $api->get('egg', 'IndexController@index');

    //后台
    //登录
    $api->post('login', 'AuthController@authenticate');
    $api->group(['middleware' => 'jwt.chxq_auth'], function ($api) {
        $api->get('metas', 'MetaController@index');
        $api->post('meta', 'MetaController@create');
    });

});