Ejemplo n.º 1
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    Get("/", "WelcomeController@show").name("welcome"),
    Get("/entries", "EntryController@show"),
    Post("/entry/create", "EntryController@store"),
    Get("/entry", "EntryController@create"),
]

ROUTES = ROUTES + [
    Get().route("/login", "LoginController@show").name("login"),
    Get().route("/logout", "LoginController@logout").name("logout"),
    Post().route("/login", "LoginController@store"),
    Get().route("/register", "RegisterController@show").name("register"),
    Post().route("/register", "RegisterController@store"),
    # Show user their Weekly entries on successful login
    Get().route("/home", "EntryController@show").name("home"),
    Get().route("/email/verify",
                "ConfirmController@verify_show").name("verify"),
    Get().route("/email/verify/send", "ConfirmController@send_verify_email"),
    Get().route("/email/verify/@id:signed", "ConfirmController@confirm_email"),
    Get().route("/password",
                "PasswordController@forget").name("forgot.password"),
    Post().route("/password", "PasswordController@send"),
    Get().route("/password/@token/reset",
                "PasswordController@reset").name("password.reset"),
    Post().route("/password/@token/reset", "PasswordController@update"),
]
Ejemplo n.º 2
0
def post(url, controller):
    """
    Shortcut for POST http
    """
    return Post().route(url, controller)
Ejemplo n.º 3
0
"""Web Routes."""

from masonite.routes import Get, Post, Put, Patch, Delete, RouteGroup

from app.http.controllers.PdfController import PdfController

ROUTES = [
    Get('/', 'WelcomeController@show').name('welcome'),
    RouteGroup([
        Get('/index', PdfController.index),
        Get('/create', PdfController.create),
        Post('/store', PdfController.store),
        Get('/download/@filename', PdfController.show),
    ], prefix='/pdfs', name='pdfs.')
]

ROUTES = ROUTES + [
    Get().route('/login', 'LoginController@show').name('login'),
    Get().route('/logout', 'LoginController@logout').name('logout'),
    Post().route('/login', 'LoginController@store'),
    Get().route('/register', 'RegisterController@show').name('register'),
    Post().route('/register', 'RegisterController@store'),
    Get().route('/home', 'HomeController@show').name('home'),
    Get().route('/email/verify', 'ConfirmController@verify_show').name('verify'),
    Get().route('/email/verify/@id:signed', 'ConfirmController@confirm_email'),
    Get().route('/email/verify/@id:signed', 'ConfirmController@confirm_email'),
    Get().route('/password', 'PasswordController@forget').name('forgot.password'),
    Post().route('/password', 'PasswordController@send'),
    Get().route('/password/@token/reset', 'PasswordController@reset').name('password.reset'),
    Post().route('/password/@token/reset', 'PasswordController@update'),
]
Ejemplo n.º 4
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    #Get('/', 'WelcomeController@show').name('welcome'),

    #Weather App
    Get('/', 'WeatherController@show'),
    Post('/add', 'WeatherController@store'),
    Get('/@id/delete', 'WeatherController@delete')
]
Ejemplo n.º 5
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    Get('/', 'WelcomeController@show').name('welcome'),
    Get('/callback', 'NylasController@oauthcallback'),
]

PROFILE_ROUTES = [
    Get('/profile',
        'ProfileController@show').name('profile').middleware('auth'),
    Post('/avatar',
         'ProfileController@saveavatar').name('avatar').middleware('auth'),
    Get('/profile/details', 'ProfileController@getPersonaldetails').name(
        'email_accounts').middleware('auth'),
    Post('/profile/update', 'ProfileController@updateUserDetails').name(
        'profile_update').middleware('auth'),
    Post('/profile/update/openhours',
         'ProfileController@updateUserOpenHours').name(
             'profile_update_open_hours').middleware('auth'),
    Get('/accounts/email', 'ProfileController@getEmailAccounts').name(
        'email_accounts').middleware('auth'),
    Get('/accounts/calendar', 'ProfileController@getCalendarAccounts').name(
        'cal_accounts').middleware('auth'),
    Get('/accounts/contact', 'ProfileController@getContactAccounts').name(
        'contact_accounts').middleware('auth'),
    Post('/accounts/delete', 'ProfileController@deleteAccount').name(
        'delete_account').middleware('auth'),
    Post('/demo-data/accounts', 'ProfileController@createDemoAccounts').name(
        'demo_accounts').middleware('auth'),
Ejemplo n.º 6
0
"""Web Routes."""

from masonite.routes import Get, Post, Redirect, RouteGroup, Patch

ROUTES = [
    Get().route('/test', None).middleware('auth'),
    Get().route('/queue', 'TestController@queue'),
    Redirect('/redirect', 'test'),
    Get().domain('test').route('/test', None).middleware('auth'),
    Get().domain('test').route('/unit/test',
                               'TestController@testing').middleware('auth'),
    Get().domain('test').route('/test/route', 'TestController@testing'),
    Get('/json_response', 'TestController@json_response'),
    Post('/test/post/route', 'TestController@post_test'),
    Get('/login', 'TestController@testing').name('login'),
    Get('/test/param/@id', 'TestController@testing'),
    Post('/test/json/response/@id', 'TestController@json'),
    Get('/test/set/test/session', 'TestController@session'),
    RouteGroup([
        Get('/test/1', 'TestController@show'),
        Get('/test/2', 'TestController@show')
    ],
               prefix='/example'),
    RouteGroup([
        Get('/test/get', 'UnitTestController@show'),
        Get('/test/param/@post_id', 'UnitTestController@param'),
        Post('/test/post', 'UnitTestController@store').middleware('test'),
        Get('/test/get/params',
            'UnitTestController@get_params').name('get.params'),
        Post('/test/params', 'UnitTestController@params'),
        Post('/test/user', 'UnitTestController@user'),
Ejemplo n.º 7
0
""" Web Routes """
from masonite.routes import Get, Post

ROUTES = [
    Get('/', 'IndexController@show').name('index.show'),
    Get('/samples', 'SampleController@many').name('sample.many'),
    Get('/sample/@id', 'SampleController@one').name('sample.one'),
    Post('/samples/create', 'SampleController@create').name('sample.create')
]
Ejemplo n.º 8
0
""" Web Routes """
from masonite.routes import Get, Post

from api.routes import JWTRoutes, TokenRoutes
from app.resources.UserResource import UserResource

ROUTES = [
    Get().route('/', 'WelcomeController@show').name('welcome'),
    UserResource('/api/user').routes(),
    TokenRoutes('/token'),
    JWTRoutes('/authorize'),
]

ROUTES = ROUTES + [
    Get().route('/login', 'LoginController@show'),
    Get().route('/logout', 'LoginController@logout'),
    Post().route('/login', 'LoginController@store'),
    Get().route('/register', 'RegisterController@show'),
    Post().route('/register', 'RegisterController@store'),
    Get().route('/home', 'HomeController@show'),
]
Ejemplo n.º 9
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    Get('/', 'HomeController@show'),
    Get('/world-map', 'MapController@show'),
    Get('/world-statistics', 'CountriesController@show'),
    Post('/world-statistics', 'CountriesController@sortData')
]

#this is the routes page where all the routes are sent to the controllers to handle them we can see get and post methods
#the post method is actually used to get the request from the sorting page and then it goes to the controller
Ejemplo n.º 10
0
from masonite.routes import Get, Post, Delete, Patch, RouteGroup

ROUTES = [
    RouteGroup(
        [
            Get().route("", "TodosController@index"),
            Post().route("", "TodosController@create"),
            Delete().route("", "TodosController@deleteAll"),
        ],
        name="todos.",
        prefix="/",
        add_methods=["OPTIONS"],
    ),
    RouteGroup(
        [
            Get().route("@id", "TodosController@show"),
            Patch().route("@id", "TodosController@update"),
            Delete().route("@id", "TodosController@delete"),
        ],
        name="todo.",
        prefix="/",
        add_methods=["OPTIONS"],
    ),
]
Ejemplo n.º 11
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    Get('/home', 'WelcomeController@show').name('welcome'),
    Get('/', 'LightsController@show'),
    Post('/', 'LightsController@update')
]
Ejemplo n.º 12
0
"""Web Routes."""

from masonite.routes import RouteGroup, Get, Post, Put, Delete

ROUTES = [
    RouteGroup([
        # Authentication
        Post('/users/login', 'AuthController@login'),

        # User
        Post('/users', 'UserController@create'),
        Get('/user', 'UserController@current_user').middleware('auth'),
        Put('/user', 'UserController@update').middleware('auth'),

        # Profiles
        RouteGroup([
            Get('', 'ProfileController@show'),
            Post('follow', 'ProfileController@follow'),
            Delete('follow', 'ProfileController@unfollow'),
        ], middleware=('auth',), prefix='/profiles/@username'),

        # Articles
        Get('/articles', 'ArticleController@index'),

        RouteGroup([
            Post('', 'ArticleController@create'),
            Get('/feed', 'ArticleController@feed'),
            Put('/@slug', 'ArticleController@update'),
            Delete('/@slug', 'ArticleController@delete'),
            Post('/@slug/favorite', 'ArticleController@favorite'),
            Delete('/@slug/favorite', 'ArticleController@unfavorite'),
Ejemplo n.º 13
0
"""Web Routes."""

from masonite.routes import Get, Post

ROUTES = [
    Get("/", "WelcomeController@show").name("welcome"),
    Get("/sample", "WelcomeController@show").name("welcome"),
    Post("/", "WelcomeController@upload"),
]