Cosmic JS Function Starter
Switch branches/tags
Nothing to show
Clone or download
Latest commit bdb50a9 Sep 10, 2018
Failed to load latest commit information.
.gitignore fix get issue in Postman Aug 27, 2018 Update Sep 10, 2018
function.json route options Aug 26, 2018 envent body stringify Aug 26, 2018
index.js fix get issue in Postman Aug 27, 2018
package-lock.json route options Aug 26, 2018
package.json route options Aug 26, 2018

Function Starter

Cosmic JS Function Starter.

Getting Started

You can run this Function locally for development:

git clone
cd function-starter
npm install
npm run develop


  1. Login to Cosmic JS and go to Your Bucket > Settings > Functions
  2. Add the link to this repo: and click "Install Function"

function.json file properties

Key Type Description
title String Function title
description String Function description (HTML allowed)
image_url String Image thumbnail
repo_url String Function git repo url
env_vars Array key / value for environment variables
routes Array Function routes: properties include path (string), method (string) and cors (bool)

Example function.json file:

  "title": "Function Starter",
  "description": "Cosmic JS Function starter.",
  "image_url": "",
  "repo_url": "",
  "env_vars": [
      "key": "CUSTOM_MESSAGE",
      "value": ""
  "routes": [
      "path": "hello-world",
      "method": "get",
      "cors": true