-
Notifications
You must be signed in to change notification settings - Fork 4
4. Integrating with your own back end
Vue Headless CMS has been designed to easily integrate with your own back-end, some ideas:
- A custom Nodejs or PHP backend to save data.json and images to disk
- The Github API to save directly to Github (I'm working on such an integration right now)
- The S3 API to save directly to any S3-compatible storage
Vue Headless CMS sends POST/GET requests to 3 endpoints, which can be configured in app-config.json:
This is where the updated data and images are posted to. Parameters that are sent to the server:
-
type - which type of content? Options:
json
orimage
-
path - the filename of the file. This will always be
data.json
in the case of json data, and a random filename in the case of an image. - content - the json data or base64 image data
This URL should return a json response of ok=true
on success, and ok=false
on error.
URL where the filename of an image that needs to be deleted is posted to
-
type - this will always be
image
- path - the filename of the file to be deleted
This URL should return a json response of ok=true
on success, and ok=false
on error
URL of the folder where images are stored. The filename of the image will be automatically appended to the GET request. If you're integrating with the Github API, it's best to use the raw Github URL, e.g.
https://raw.githubusercontent.com/{owner}/{repo}/main/public/img/