Created
April 13, 2013 09:05
-
-
Save jkresner/5377677 to your computer and use it in GitHub Desktop.
Deploy brunch to heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log "app node file", process.cwd() | |
mongoose = require 'mongoose' | |
express = require 'express' | |
app = express() | |
app.configure -> | |
app.use express.static(__dirname + '/public') | |
app.use express.bodyParser() | |
require('./app_routes')(app) | |
mongoUri = process.env.MONGOHQ_URL || 'mongodb://localhost/airpair_dev' | |
mongoose.connect mongoUri | |
db = mongoose.connection | |
db.on('error', console.error.bind(console, 'connection error:')) | |
db.once 'open', -> | |
console.log 'connected to db' | |
exports.startServer = (port, path, callback) -> | |
p = process.env.PORT || port | |
console.log "startServer on port: #{p}, path #{path}" | |
app.listen p | |
isHeroku = process.env.MONGOHQ_URL? | |
if isHeroku | |
exports.startServer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{config} = require './config' | |
config.server.port = 5000 | |
config.files.javascripts.joinTo = | |
# note removed test files from the release build | |
'test/javascripts/test.js': /^test(\/|\\)(?!vendor)/ | |
'test/javascripts/test-vendor.js': /^test(\/|\\)(?=vendor)/ | |
exports.config = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See docs at http://brunch.readthedocs.org/en/latest/config.html. | |
exports.config = | |
server: | |
path: 'app.coffee', port: 3333, base: '/', run: yes | |
files: | |
javascripts: | |
joinTo: | |
'javascripts/app.js': /^app/ | |
'javascripts/vendor.js': /^vendor/ | |
'test/javascripts/test.js': /^test(\/|\\)(?!vendor)/ | |
'test/javascripts/test-vendor.js': /^test(\/|\\)(?=vendor)/ | |
order: | |
# Files in `vendor` directories are compiled before other files | |
# even if they aren't specified in order. | |
before: [ | |
'vendor/scripts/jquery.js' | |
'vendor/scripts/lodash.js' | |
'vendor/scripts/backbone.js' | |
] | |
stylesheets: | |
joinTo: | |
'stylesheets/app.css': /^(app|vendor)/ | |
'test/stylesheets/test.css': /^test/ | |
order: | |
before: [ | |
'vendor/styles/normalize.css', | |
'vendor/styles/bootstrap.css' | |
] | |
after: ['vendor/styles/helpers.css'] | |
templates: | |
joinTo: 'javascripts/app.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"author": "Jonathon Kresner", | |
"name": "airpair.com", | |
"description": "site hosted at airpair.com", | |
"version": "0.0.1", | |
"homepage": "http://airpair.com/", | |
"repository": { | |
"type": "git", | |
"url": "" | |
}, | |
"engines": { | |
"node": "0.8.x", | |
"npm": "1.1.x" | |
}, | |
"scripts": { | |
"postinstall": "brunch build -c config-release.coffee" | |
}, | |
"dependencies": {}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: ./node_modules/.bin/coffee app.coffee |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in app.coffee, I do this, instead, and it works for anything that requires vs runs directly: