SR
Click to open github profile
Get Started

Configuration

Learn how to configure the Craft Query API Craft CMS plugin.


That configurations are optional, but recommended if you plan to use Craft CMS in headless mode only.

Headless Mode

Set headless mode in your config/general.php to true.

Note

Read more about the headless mode.

Enable Preview

To enable previewing entries etc. you have to tell Craft CMS, where the frontend lives.

Add a new env var:

.env
WEBSITE_URL="http://localhost:3000"

Add new alias to Craft CMS:

Now add this recently created env var to your config/general.php as an alias.

config/general.php
->aliases([
    '@websiteUrl' => getenv('WEBSITE_URL'),
])

Change Site URL

And finally go to your control panel settings -> sites -> and change the base URL of your Site. If you click on the Craft CMS logo in the left top corner, you should land on your defined WEBSITE_URL


Copyright © 2024 Samuel Reichör