Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Created January 16, 2022 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marlysson/18a0285774ed50e61a5010fdbdf6d0bd to your computer and use it in GitHub Desktop.
Save Marlysson/18a0285774ed50e61a5010fdbdf6d0bd to your computer and use it in GitHub Desktop.
Details api masonite
# api.py
from masonite.routes import Route
ROUTES = [
Route.get('/podcasts', 'api.PodcastController@index')
]
# web.py
from masonite.routes import Route
from masonite.api import Api
ROUTES = [
Route.api('podcasts', "api.PodcastController"),
]
ROUTES += Api.routes(auth_route="/api/auth", reauth_route="/api/reauth")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment