How to use the masonite.helpers.routes.get function in masonite

To help you get started, we’ve selected a few masonite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MasoniteFramework / masonite / tests / test_helpers_urls.py View on Github external
def test_get_sets_route(self):
        assert routes.get('test', None)
        assert isinstance(routes.get('test', None), Get)
github MasoniteFramework / masonite / tests / test_helpers_urls.py View on Github external
def test_get_sets_route(self):
        assert routes.get('test', None)
        assert isinstance(routes.get('test', None), Get)
github nioperas06 / masonite-forum / routes / web.py View on Github external
''' Web Routes '''
from masonite.helpers.routes import get, post
from masonite.routes import RouteGroup as group

ROUTES = [
    get('/', 'HomeController@index').name('home'),
    get('/login', 'LoginController@show').name('login'),
    post('/login', 'LoginController@store'),
    get('/register', 'RegisterController@show').name('register'),
    post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
github nioperas06 / masonite-forum / routes / web.py View on Github external
group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes
        group([
            get('/questions', 'QuestionController@questions').name('questions'),
            get('/answers', 'AnswerController@answers').name('answers'),
        ], prefix='/me', name='me.')
    ], middleware = ('auth',)),
]
github nioperas06 / masonite-forum / routes / web.py View on Github external
''' Web Routes '''
from masonite.helpers.routes import get, post
from masonite.routes import RouteGroup as group

ROUTES = [
    get('/', 'HomeController@index').name('home'),
    get('/login', 'LoginController@show').name('login'),
    post('/login', 'LoginController@store'),
    get('/register', 'RegisterController@show').name('register'),
    post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
github nioperas06 / masonite-forum / routes / web.py View on Github external
post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes
        group([
            get('/questions', 'QuestionController@questions').name('questions'),
            get('/answers', 'AnswerController@answers').name('answers'),
        ], prefix='/me', name='me.')
    ], middleware = ('auth',)),
]
github nioperas06 / masonite-forum / routes / web.py View on Github external
get('/register', 'RegisterController@show').name('register'),
    post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes
        group([
            get('/questions', 'QuestionController@questions').name('questions'),
            get('/answers', 'AnswerController@answers').name('answers'),
        ], prefix='/me', name='me.')
    ], middleware = ('auth',)),
]
github nioperas06 / masonite-forum / routes / web.py View on Github external
get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes
        group([
            get('/questions', 'QuestionController@questions').name('questions'),
            get('/answers', 'AnswerController@answers').name('answers'),
        ], prefix='/me', name='me.')
    ], middleware = ('auth',)),
]
github nioperas06 / masonite-forum / routes / web.py View on Github external
''' Web Routes '''
from masonite.helpers.routes import get, post
from masonite.routes import RouteGroup as group

ROUTES = [
    get('/', 'HomeController@index').name('home'),
    get('/login', 'LoginController@show').name('login'),
    post('/login', 'LoginController@store'),
    get('/register', 'RegisterController@show').name('register'),
    post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes
        group([
github nioperas06 / masonite-forum / routes / web.py View on Github external
''' Web Routes '''
from masonite.helpers.routes import get, post
from masonite.routes import RouteGroup as group

ROUTES = [
    get('/', 'HomeController@index').name('home'),
    get('/login', 'LoginController@show').name('login'),
    post('/login', 'LoginController@store'),
    get('/register', 'RegisterController@show').name('register'),
    post('/register', 'RegisterController@store').name('register'),
    get('/questions/@id:int', 'QuestionController@show').name('questions.show'),
    get('/categories/@id:int/questions', 'CategoryController@index').name('categories.questions.index'),
    get('/users/@id:int', 'UserController@show').name('users.show'),

    group([
        get('/logout', 'LoginController@logout').name('logout'),

        # Question Routes
        group([
            get('/create', 'QuestionController@create').name('create'),
            post('', 'QuestionController@store').name('store'),
            post('/@id/answers', 'AnswerController@store').name('answers'),
            post('/@id/answers/@answer_id/accept', 'QuestionController@accept_answer').name('accept'),
            get('/@id/upvote', 'QuestionController@upvote').name('upvote'),
            get('/@id/downvote', 'QuestionController@downvote').name('downvote'),
        ], prefix='/questions', name='questions.'),

        # Me Routes