This one’s been doing my head in over the course of this week. I’ve tried the
/cockpit/defines.php approach to no avail as well. Printing them out in the
login.php looks right to me either way. There’s
[COCKPIT_API_REQUEST] => 0 which I couldn’t find explained in the documentation, just that it exists. Should this be somehow set to
on for the to work?
<?php define('COCKPIT_BASE_URL', '/cockpit'); define('COCKPIT_BASE_ROUTE', '/cockpit'); define('COCKPIT_DOCS_ROOT', dirname(__DIR__));
To evaluate Cockpit I’ve set it up locally as I always do with a standard sandboxed MAMP environment.
Below is the error I get when I
curl http://localhost:8888/cockpit/api/collections/get/posts?token=account-2771ca3447t6d84dba0c40c4c46625 (the generated token is from an admin user)
PHP Notice: Undefined index: admin in /Applications/MAMP/htdocs/cockpit/lib/Lime/App.php on line 1261
I’m looking to use Cockpit to generate Hugo input files, hence I need APIs to work in order to create a tool for doing so (yes, I’m aware of Hugocockpit, but it omits too much of the needed content and can’t be deployed in scenarios where end-users are involved).
Help to get APIs working would be greatly appreciated.