Created
March 11, 2016 20:31
-
-
Save michaelmendoza/6ad71e680c874a9dd947 to your computer and use it in GitHub Desktop.
Using Brunch with 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
module.exports = config: | |
modules: | |
definition: 'amd' | |
wrapper: 'amd' | |
files: | |
javascripts: joinTo: 'app.js' | |
stylesheets: joinTo: 'app.css' | |
paths: | |
watched: 'src' | |
public: 'build' |
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
{ | |
"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" | |
} | |
} |
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 server.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
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