Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jelleschutter/redaxo-headless
Add API functions which allow working with a frontend framework
https://github.com/jelleschutter/redaxo-headless
redaxo redaxo-addon
Last synced: 17 days ago
JSON representation
Add API functions which allow working with a frontend framework
- Host: GitHub
- URL: https://github.com/jelleschutter/redaxo-headless
- Owner: jelleschutter
- License: mit
- Created: 2020-07-31T21:54:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-12T00:35:48.000Z (almost 4 years ago)
- Last Synced: 2023-03-03T21:36:54.084Z (almost 2 years ago)
- Topics: redaxo, redaxo-addon
- Language: PHP
- Homepage: https://headless.jelle.server4.bluemouse.ch
- Size: 30.3 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# REDAXO Headless - SPA + REDAXO = :heart:
The goal of the REDAXO Headless ecosystem is to offer a developer approach to integrating SPAs into REDAXO. The setup will usually consist out of the following three sub-systems:
- [REDAXO AddOn](#redaxo-addon)
- [Example SPA](https://github.com/jelleschutter/redaxo_headless_vue_frontend)
- [GitHub Action for deployment](https://github.com/jelleschutter/redaxo-headless-deploy)
## REDAXO AddOn
The REDAXO AddOn provides API endpoints to allow easy access to page content from the SPA. Currently there are three endpoints:
- [Navigation](#navigation)
- [Content](#content)
- [Deploy](#deploy)
### Navigation
Using the navigation endpoint you can get the information needed for a nav bar.
**URL** | **Method**
--- | ---
/?rex-api-call=headless_nav | `GET`
#### URL Params
**Name** | **Type** | **Required** | **Default**
--- | --- | --- | ---
path | string | Yes | -
levels | number | No | 2
#### Example Response
```
[
{
"id": 1,
"link": "/",
"name": "Home",
"current": true,
"active": true
},
{
"id": 2,
"link": "/test/",
"name": "Test Category",
"current": false,
"active": false,
"children": [
{
"id": 2,
"link": "/test/",
"name": "Test Article",
"current": false,
"active": false
},
{
"id": 3,
"link": "/test/new-article/",
"name": "New Article",
"current": false,
"active": false
}
]
}
]
```
### Navigation
Using the navigation endpoint you can get the information needed for a nav bar.
**URL** | **Method**
--- | ---
/?rex-api-call=headless_content | `GET`
#### URL Params
**Name** | **Type** | **Required** | **Note**
--- | --- | --- | ---
path | string | Yes | Path relative to root without leading slash. Therefore the root article is requested by leaving the path empty.
#### Example Response
```
{
"meta": {
"title": "Home / REDAXO",
"description": ""
},
"title": "Home",
"content": "This is some content.
"
}
```### Deploy
The deploy endpoint is a part of the deploy plugin which has to be enabled separately on the addon system page.
The deployment function used by the headless deployment github action. For more info see: [redaxo-headless-deploy](https://github.com/jelleschutter/redaxo-headless-deploy)
**URL** | **Method**
--- | ---
/?rex-api-call=headless_deploy | `POST`
#### POST Params
**Name** | **Type** | **Required** | **Notes**
--- | --- | --- | ---
token | string | Yes | Defined in the REDAXO backend in the deploy plugin.
file | file | Yes | ZIP file containing the built SPA code at the root.
#### Example Response
```
{
"msg": "Successfully updated content!"
}
```