Apostrophe CMS Main Site Forum Home

Apostrophe-headless: using Apostrophe as a backend to React apps, native apps, Vue apps and more


#1

We’re pleased to announce the release of apostrophe-headless. apostrophe-headless is a new module that adds a REST API to content types you create with apostrophe-pieces. While most often used for read-only access it is also fully capable of write operations.

The apostrophe-headless module works together with Apostrophe’s pieces and schemas to provide the fastest possible road to an application with access to all the data it needs, including full access to joins.

See:

Enjoy!


#2

This looks really great, I’ve been playing around with it. I have a question, is there any way to configure it to do single item look-ups with values other than ‘_id’? Slug seems to be a natural need no?


#3

Yes, you can:

“You can use any cursor filter that has a sanitize method via the query string. It’s not hard to add custom filters.”

This means you can use ?title=xxx, etc. to look for exact matches. See the cursor filter documentation:


#4

(Note that there are also “search” and “autocomplete” cursor filters you may find very useful.)


#5

Thank you! I’m off to the races.
Cheers.


#6

I have another question :slight_smile:
This is regarding using apostrophe-headless with apostrophe-blog.
I’ve been digging in and for some reason when I attempt to add the restApi value to the apostrophe-blog config, I’m not getting anything from the api. Apostrophe-blog is an extension of apostrophe-pieces, I’m wondering what I’m missing. Is this not intended to work in this fashion? Hoping this can be answered really easily


#7

Hi Blaine, please send how-to questions to stackoverflow and tag them apostrophe-cms. It is much easier for others to find those answers later there. The forum is for announcements and general discussion. Thanks!