This is a dummy implementation of a Libero API for development and testing purposes.
To run an API with two content services (blog-articles and research-articles):
-
Create
config/packages/content_api.yaml. This contains:# Libero content APIs content_api: services: blog-articles: items: libero.dummy_api.content_api.blog_articles research-articles: items: libero.dummy_api.content_api.research_articles # Symfony services to read the content, one per content API services: _defaults: autowire: true autoconfigure: true public: false libero.dummy_api.content_api.blog_articles: class: Libero\ContentApiBundle\Adapter\FilesystemItems arguments: - '%kernel.data_dir%/blog-articles' libero.dummy_api.content_api.research_articles: class: Libero\ContentApiBundle\Adapter\FilesystemItems arguments: - '%kernel.data_dir%/research-articles'
-
Create the
data/blog-articlesanddata/research-articlesdirectories. -
Place content inside these two directories. Each item must have its own directory (when its ID as the name), and one or more version files inside (named
{number}.xml). The root element of these files is{http://libero.pub}item.For example:
data ├── blog-articles │ ├── post1 │ │ ├── 1.xml │ │ └── 2.xml │ └── post2 │ └── 1.xml └── research-articles └── article1 └── 1.xml -
Run
docker-compose down -v && docker-compose up --build. -
Open http://localhost:8080/blog-articles/items to see the list of two posts.
- Report a bug or request a feature on GitHub.
- Ask a question on the Libero Community Slack.
- Read the code of conduct.