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 1 for on for the to work?
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)
From php_error.log
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.
Thank you so much! That did it! I’ve been trying to decipher the what-does-what for a couple of days now.
The biggest error I had with HugoCockpit was that it didn’t output anything. Apache log then revealed the issue. It adds a --canonifyURLs parameter which doesn’t exist. Maybe it did at some point but now it doesn’t. (It’s part of the Hugo config file now.)