This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

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

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!

1 Like

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?

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:

http://apostrophecms.org/docs/tutorials/intermediate/cursors.html

1 Like

(Note that there are also ā€œsearchā€ and ā€œautocompleteā€ cursor filters you may find very useful.)

Thank you! Iā€™m off to the races.
Cheers.

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

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!

1 Like