#!/bin/bash
npm install -S cson-config
npm install -S git+http://git.ccl/hera/broker-client.git#develop
###
cat << 'EOF' > config.cson
brokerUrl: process.env.BROKER or 'jsonrpc2://api.ccl'
port: process.env.PORT or 5000
EOF
###
cat << 'EOF' > index.coffee
require('cson-config').load()
bc = require('broker-client') process.config.brokerUrl
bc.get '/0/foo/bar', (req, res, next) ->
res.json foo: 'bar'
bc.listen process.config.port
console.log "Listening #{process.config.port}"
EOF
###
cat << 'EOF' > .env
HERA_VERSION_PREFIX=dev
EOF
cat << 'EOF' > .gitignore
node_modules
.env
EOF