Skip to content

4. Integrating with your own back end

Dashpilot edited this page Mar 12, 2022 · 1 revision

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

Endpoints

Vue Headless CMS sends POST/GET requests to 3 endpoints, which can be configured in app-config.json:

save_url (POST)

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 or image
  • 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.

image_delete_url (POST)

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

image_preview_url (GET)

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/

Clone this wiki locally