Skip to content

Instantly share code, notes, and snippets.

@michaelmendoza
Created March 11, 2016 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelmendoza/6ad71e680c874a9dd947 to your computer and use it in GitHub Desktop.
Save michaelmendoza/6ad71e680c874a9dd947 to your computer and use it in GitHub Desktop.
Using Brunch with Heroku
module.exports = config:
modules:
definition: 'amd'
wrapper: 'amd'
files:
javascripts: joinTo: 'app.js'
stylesheets: joinTo: 'app.css'
paths:
watched: 'src'
public: 'build'
{
"name": "app",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "node server.js",
"postinstall": "./node_modules/brunch/bin/brunch build"
},
"dependencies": {
"express": "~4.13.x",
"brunch": "^2.4.2",
"javascript-brunch": "^2.0.0",
"sass-brunch": "^2.0.0"
},
"engines": {
"node": "4.4.0"
}
}
web: node server.js
var express = require('express');
var app = express();
var path = require('path');
var port = process.env.PORT || 3000;
app.use(express.static(path.join(__dirname, '../build')));
app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, '../build', 'index.html'));
});
app.listen(port);
console.log("App listening on port " + port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment