Skip to content

Instantly share code, notes, and snippets.

@donniewa
Created May 14, 2014 04:45
Show Gist options
  • Save donniewa/cc086c2680b3663b8724 to your computer and use it in GitHub Desktop.
Save donniewa/cc086c2680b3663b8724 to your computer and use it in GitHub Desktop.
SynthJS + Heroku
  • Move Synth.js, and the entire lib directory in node_modules/synth/lib into your main folder.
  • Your front and back folders are under app/
2014-05-14T04:27:17.114937+00:00 heroku[web.1]: Starting process with command `node web.js`
2014-05-14T04:27:19.248185+00:00 app[web.1]:
2014-05-14T04:27:19.248256+00:00 app[web.1]: module.js:340
2014-05-14T04:27:19.248761+00:00 app[web.1]: throw err;
2014-05-14T04:27:19.248768+00:00 app[web.1]: ^
2014-05-14T04:27:19.249925+00:00 app[web.1]: Error: Cannot find module '/app/back/back-app.js'
2014-05-14T04:27:19.249928+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-05-14T04:27:19.249930+00:00 app[web.1]: at Function.require.resolve (module.js:384:19)
2014-05-14T04:27:19.249932+00:00 app[web.1]: at requireUncached (/app/lib/commands.js:61:14)
2014-05-14T04:27:19.249933+00:00 app[web.1]: at startServer (/app/lib/commands.js:81:15)
2014-05-14T04:27:19.249935+00:00 app[web.1]: at Object.exports.startServer (/app/lib/commands.js:110:5)
2014-05-14T04:27:19.249936+00:00 app[web.1]: at Object.<anonymous> (/app/web.js:23:10)
2014-05-14T04:27:19.249938+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-05-14T04:27:19.249939+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-05-14T04:27:19.249942+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-05-14T04:27:19.249943+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-05-14T04:27:19.249945+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-05-14T04:27:19.249946+00:00 app[web.1]: at startup (node.js:119:16)
2014-05-14T04:27:19.249948+00:00 app[web.1]: at node.js:906:3
2014-05-14T04:27:19.249949+00:00 app[web.1]:
2014-05-14T04:27:20.626697+00:00 heroku[web.1]: State changed from starting to crashed
2014-05-14T04:27:20.606433+00:00 heroku[web.1]: Process exited with status 8
{
"name": "HerokuSynthDemo",
"description": "Heroku & Synth - Demo",
"version": "0.0.1",
"private": true,
"dependencies": {
"optimist": "^0.6.0",
"mkdirp": "^0.3.5",
"lodash": ">=2.4.0",
"express": "^4",
"methods": "^0.1.0",
"wrench": "^1.5.8",
"jade": "^1.0.0",
"harp": "^0.11.2",
"bower": "^1.2.8",
"npm": "^1.3.23",
"uglify-js": "^2.4.12",
"coffee-script": "^1.7.1",
"ngmin": "^0.4.0",
"node-sass": "^0.7.0",
"clean-css": "^2.0.7",
"stylus": "^0.42.2",
"gulp": "3.5.1",
"bluebird": "^1.0.3",
"nopt": "^2.2.0",
"connect": "^2.14.4",
"st": "^0.4.1",
"synth": "^0.4.14",
"promised-mongo": "^0.11"
},
"engines": {
"node": "0.10.x"
}
}
web: node web.js
#!/usr/bin/env node
process.title = 'synth';
/* Third-party Modules */
var mkdirp = require('mkdirp'),
pkg = require('./package.json'),
version = pkg.version,
os = require('os'),
fs = require('fs'),
path = require('path'),
_ = require('lodash'),
npm = require('npm'),
bower = require('bower');
/* Local modules */
var commands = require('./lib/commands.js');
var mode = 'development';
// if (process.env.NODE_ENV == 'production') {
// process.env.NODE_ENV = mode = 'production';
// }
var port = Number(process.env.PORT || 3000);
commands.startServer(mode, port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment