diff options
author | Marvin Borner | 2018-07-09 19:57:19 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-09 19:57:19 +0200 |
commit | 75adb031897ab2a2b66051e1acb186bfdff6a4a4 (patch) | |
tree | 5cacef38857ba9d76342bdca79fc77754a908e38 /routes | |
parent | 0675967adc29e267f7b15bd9f9090bb16cb0339b (diff) |
Better API
Diffstat (limited to 'routes')
-rw-r--r-- | routes/keys.php | 18 | ||||
-rw-r--r-- | routes/web.php | 3 |
2 files changed, 18 insertions, 3 deletions
diff --git a/routes/keys.php b/routes/keys.php new file mode 100644 index 0000000..52c7b3a --- /dev/null +++ b/routes/keys.php @@ -0,0 +1,18 @@ +<?php +/* +|-------------------------------------------------------------------------- +| Routes for public keys +|-------------------------------------------------------------------------- +| +| Here is where you can register web routes for your application. These +| routes are loaded by the RouteServiceProvider within a group which +| contains the "web" middleware group. Now create something great! +| + */ +Auth::routes(); +Route::middleware('auth', 'throttle:30') // throttle to 30 per minute + ->group(function () { + Route::get('keys/cookie/public/', 'PublicKeyController@setUsersKeyByCookie'); + Route::get('keys/public/{user_id}', 'PublicKeyController@getUsersKey'); + Route::post('keys/public', 'PublicKeyController@setUsersKey'); + }); diff --git a/routes/web.php b/routes/web.php index c0c8f47..0b980a1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,10 +15,7 @@ Route::middleware('auth', 'throttle:30') // throttle to 30 per minute Route::get('/', ['as' => 'writeMessage', 'uses' => 'SocketController@writeMessage']); Route::get('avatar/{user_id}', 'ImageController@getAvatar'); Route::get('profile', 'UserController@Profile'); - Route::get('keys/cookie/public/', 'PublicKeyController@setUsersKeyByCookie'); // actually it's a post but it has to be get (via cookie) => TODO: - Route::get('keys/public/{user_id}', 'PublicKeyController@getUsersKey'); Route::post('avatar', 'UserController@updateAvatar'); - Route::post('keys/public', 'PublicKeyController@setUsersKey'); Route::post('sendMessage', 'SocketController@sendMessage'); }); |