I have had no problems deploying the getting started node app at heroku. My next goal was to deploy the default node app generated by Webstorm 8.0 ide when selecting a node project. I followed the video Getting started with Express found here: http://blog.jetbrains.com/webstorm/2014/05/guide-to-node-js-development-with-webstorm/
I Tested the app locally & got it to run.
Deployed by starting terminal and logging in to my heroku account.
MacBook:helgoWS $ heroku apps:create helgows Creating helgows... done, stack is cedar http://helgows.herokuapp.com/ | git@heroku.com:helgows.git Git remote heroku added -----> Launching... done, v3 http://helgows.herokuapp.com/ deployed to Heroku
To git@heroku.com:helgows.git * [new branch] master -> master
I start the "dynos" with
MacBook:helgoWS $ heroku ps:scale web=1 Scaling dynos... done, now running web at 1:1X. MacBook:helgoWS $ heroku ps === web (1X):
node app.jsweb.1: crashed 2014/08/04 23:30:27 (~ 1m ago)
Result of logs:
MacBook:helgoWS $ heroku logs -n 1500 2014-08-04T21:24:52.703512+00:00 heroku[api]: Enable Logplex by helgo@gmail.com 2014-08-04T21:24:52.703512+00:00 heroku[api]: Release v2 created by helgo@gmail.com 2014-08-04T21:30:13+00:00 heroku[slug-compiler]: Slug compilation started 2014-08-04T21:30:19.399123+00:00 heroku[api]: Scale to web=1 by helgo@gmail.com 2014-08-04T21:30:19+00:00 heroku[slug-compiler]: Slug compilation finished 2014-08-04T21:30:19.514017+00:00 heroku[api]: Release v3 created by helgo@gmail.com 2014-08-04T21:30:19.513814+00:00 heroku[api]: Deploy 54c922f by helgo @gmail.com 2014-08-04T21:30:24.697475+00:00 heroku[web.1]: State changed from starting to crashed 2014-08-04T21:30:24.698086+00:00 heroku[web.1]: State changed from crashed to starting 2014-08-04T21:30:21.943047+00:00 heroku[web.1]: Starting process
node app.js2014-08-04T21:30:24.487283+00:00 heroku[web.1]: Process exited with status 0 2014-08-04T21:30:28.590771+00:00 heroku[web.1]: Process exited with status 0 2014-08-04T21:30:26.191041+00:00 heroku[web.1]: Starting processnode app.js2014-08-04T21:30:29.589262+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=helgows.herokuapp.com request_id=ae1baa69-4d1a-475a-8338-4619169e679f fwd="54.196.27.9" dyno= connect= service= status=503 bytes= 2014-08-04T21:30:28.605566+00:00 heroku[web.1]: State changed from starting to crashed 2014-08-04T21:31:41.003199+00:00 heroku[api]: Scale to web=1 by helgo@gmail.com 2014-08-04T21:37:44.191949+00:00 heroku[api]: Scale to web=1 by helgo@gmail.com
here is the app.js file contents:
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(favicon());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
app.use('/users', users);
/// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
/// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
module.exports = app;
Note: I am running the free version which i believed allows up to 5 apps