ChargeCharge

JSON

JSON files can be generated by creating a file with a .json.js extension and then exporting a function from it.

// feed.json.js
export default (props) => {
  return {
    title: "My blog",
    items: [],
  }
}

The function will be passed all the same props a page normally receives. Return a JavaScript object from the exported function and it will be stringified into JSON.