Installation

Last updated 2 months ago

Introduction

Masonite Entry is a remarkably simple but remarkably powerful API integration for the Masonite framework. This package is an official package for Masonite and maintained by the core developers.

Nearly every project can benefit from an API integration one way or another so we added an official package that isn't currently out of the box but works extremely well for Masonite 1.5+

Requirements

  • Masonite 2.0 +

  • Craft command tool

    • pip install masonite-cli

Installation

Installing Masonite Entry is extremely simple. The package is already installed for you but you'll need to add the Service Provider properly to your config/providers.py file:

This Service Provider needs to be in a certain spot in the list as to work between the normal HTTP routes and the response. It should be located right beneath your RouteProvider.

from entry.providers.ApiProvider import ApiProvider
...
PROVIDERS = [
...
RouteProvider,
ApiProvider,
...
]

New Commands

This Service Provider will add new commands to our craft command tool. If we run:

$ craft

We should see our new commands:

...
entry
entry:install Installs needed controllers and routes into a Masonite project
entry:resource Creates a new API resource
...

Now you're all set!

Read the Creating Resources documentation to get started.