1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00
pixelfed/routes/web.php

139 lines
6.6 KiB
PHP
Raw Normal View History

2018-04-15 23:56:48 +00:00
<?php
2018-08-10 05:20:27 +00:00
Route::domain(config('pixelfed.domain.admin'))->prefix('i/admin')->group(function() {
2018-06-01 03:35:22 +00:00
Route::redirect('/', '/dashboard');
Route::redirect('timeline', config('app.url').'/timeline');
Route::get('dashboard', 'AdminController@home')->name('admin.home');
Route::redirect('statuses', '/statuses/list');
Route::get('statuses/list', 'AdminController@statuses')->name('admin.statuses');
Route::get('statuses/show/{id}', 'AdminController@showStatus');
Route::redirect('users', '/users/list');
Route::get('users/list', 'AdminController@users')->name('admin.users');
Route::redirect('media', '/media/list');
Route::get('media/list', 'AdminController@media')->name('admin.media');
2018-04-15 23:56:48 +00:00
});
2018-04-16 00:00:49 +00:00
2018-06-14 05:30:43 +00:00
Route::domain(config('pixelfed.domain.app'))->middleware('validemail')->group(function() {
2018-06-01 03:35:22 +00:00
2018-08-10 05:20:27 +00:00
Route::get('/', 'SiteController@home')->name('timeline.personal');
Route::post('/', 'StatusController@store');
2018-06-01 03:35:22 +00:00
Auth::routes();
Route::get('.well-known/webfinger', 'FederationController@webfinger');
Route::get('.well-known/nodeinfo', 'FederationController@nodeinfoWellKnown');
Route::get('/home', 'HomeController@index')->name('home');
Route::get('discover', 'DiscoverController@home')->name('discover');
Route::get('search/hashtag/{tag}', function($tag) {
return redirect('/discover/tags/'.$tag);
});
Route::group(['prefix' => 'api'], function() {
Route::get('search/{tag}', 'SearchController@searchAPI')
->where('tag', '[A-Za-z0-9]+');
Route::get('nodeinfo/2.0.json', 'FederationController@nodeinfo');
2018-08-10 05:20:27 +00:00
Route::group(['prefix' => 'v1'], function() {
2018-08-13 02:42:07 +00:00
Route::post('avatar/update', 'ApiController@avatarUpdate');
2018-08-10 05:20:27 +00:00
Route::get('likes', 'ApiController@hydrateLikes');
});
Route::group(['prefix' => 'local'], function() {
Route::get('i/follow-suggestions', 'ApiController@followSuggestions');
Route::post('i/more-comments', 'ApiController@loadMoreComments');
});
2018-06-01 03:35:22 +00:00
});
Route::get('discover/tags/{hashtag}', 'DiscoverController@showTags');
2018-04-16 00:00:49 +00:00
2018-06-01 03:35:22 +00:00
Route::group(['prefix' => 'i'], function() {
Route::redirect('/', '/');
2018-08-10 05:20:27 +00:00
Route::get('compose', 'StatusController@compose')->name('compose');
2018-06-01 03:35:22 +00:00
Route::get('remote-follow', 'FederationController@remoteFollow')->name('remotefollow');
Route::post('remote-follow', 'FederationController@remoteFollowStore');
Route::post('comment', 'CommentController@store');
2018-06-01 21:04:33 +00:00
Route::post('delete', 'StatusController@delete');
2018-06-01 03:35:22 +00:00
Route::post('like', 'LikeController@store');
2018-08-10 05:20:27 +00:00
Route::post('share', 'StatusController@storeShare');
2018-06-01 03:35:22 +00:00
Route::post('follow', 'FollowerController@store');
Route::post('bookmark', 'BookmarkController@store');
2018-06-05 07:49:05 +00:00
Route::get('lang/{locale}', 'SiteController@changeLocale');
2018-06-14 05:30:43 +00:00
Route::get('verify-email', 'AccountController@verifyEmail');
Route::post('verify-email', 'AccountController@sendVerifyEmail');
Route::get('confirm-email/{userToken}/{randomToken}', 'AccountController@confirmVerifyEmail');
2018-06-01 03:35:22 +00:00
Route::group(['prefix' => 'report'], function() {
Route::get('/', 'ReportController@showForm')->name('report.form');
Route::get('not-interested', 'ReportController@notInterestedForm')->name('report.not-interested');
Route::get('spam', 'ReportController@spamForm')->name('report.spam');
Route::get('spam/comment', 'ReportController@spamCommentForm')->name('report.spam.comment');
Route::get('spam/post', 'ReportController@spamPostForm')->name('report.spam.post');
Route::get('spam/profile', 'ReportController@spamProfileForm')->name('report.spam.profile');
});
2018-08-10 05:20:27 +00:00
2018-06-01 03:35:22 +00:00
});
Route::group(['prefix' => 'account'], function() {
Route::redirect('/', '/');
Route::get('activity', 'AccountController@notifications')->name('notifications');
});
Route::group(['prefix' => 'settings'], function() {
Route::redirect('/', '/settings/home');
Route::get('home', 'SettingsController@home')->name('settings');
Route::post('home', 'SettingsController@homeUpdate');
Route::get('avatar', 'SettingsController@avatar')->name('settings.avatar');
2018-08-10 09:10:05 +00:00
Route::post('avatar', 'AvatarController@store');
2018-06-01 03:35:22 +00:00
Route::get('password', 'SettingsController@password')->name('settings.password');
Route::post('password', 'SettingsController@passwordUpdate');
Route::get('email', 'SettingsController@email')->name('settings.email');
Route::get('notifications', 'SettingsController@notifications')->name('settings.notifications');
Route::get('privacy', 'SettingsController@privacy')->name('settings.privacy');
Route::post('privacy', 'SettingsController@privacyStore');
2018-06-01 03:35:22 +00:00
Route::get('security', 'SettingsController@security')->name('settings.security');
Route::get('applications', 'SettingsController@applications')->name('settings.applications');
Route::get('data-export', 'SettingsController@dataExport')->name('settings.dataexport');
Route::get('developers', 'SettingsController@developers')->name('settings.developers');
});
2018-08-10 05:20:27 +00:00
Route::group(['prefix' => 'site'], function() {
Route::redirect('/', '/');
Route::get('about', 'SiteController@about')->name('site.about');
Route::view('help', 'site.help')->name('site.help');
Route::view('developer-api', 'site.developer')->name('site.developers');
Route::view('fediverse', 'site.fediverse')->name('site.fediverse');
Route::view('open-source', 'site.opensource')->name('site.opensource');
Route::view('banned-instances', 'site.bannedinstances')->name('site.bannedinstances');
Route::view('terms', 'site.terms')->name('site.terms');
Route::view('privacy', 'site.privacy')->name('site.privacy');
Route::view('platform', 'site.platform')->name('site.platform');
Route::view('language', 'site.language')->name('site.language');
});
2018-06-01 03:35:22 +00:00
Route::group(['prefix' => 'timeline'], function() {
2018-08-10 05:20:27 +00:00
Route::redirect('/', '/');
2018-06-01 03:35:22 +00:00
Route::get('public', 'TimelineController@local')->name('timeline.public');
Route::post('public', 'StatusController@store');
});
Route::group(['prefix' => 'users'], function() {
Route::redirect('/', '/');
Route::get('{user}.atom', 'ProfileController@showAtomFeed');
Route::get('{username}/outbox', 'FederationController@userOutbox');
Route::get('{user}', function($user) {
2018-08-10 05:20:27 +00:00
return redirect('/'.$user);
2018-06-01 03:35:22 +00:00
});
});
2018-06-04 06:07:40 +00:00
Route::get('p/{username}/{id}/c/{cid}', 'CommentController@show');
2018-08-10 05:31:14 +00:00
Route::get('p/{username}/{id}/c', 'CommentController@showAll');
2018-06-01 03:35:22 +00:00
Route::get('p/{username}/{id}', 'StatusController@show');
Route::get('{username}/saved', 'ProfileController@savedBookmarks');
Route::get('{username}/followers', 'ProfileController@followers');
Route::get('{username}/following', 'ProfileController@following');
Route::get('{username}', 'ProfileController@show');
});