Saturday, 3 June 2017

How to deploy to Heroku the right way?

I am trying to deploy an app to Heroku with Github. But for some reason I am getting an error in my log, that I think its referring to my Procfile. So, when I have created repo in github, to I have created a index.js that is the web server were I want Heroku to start with.. So, can anyone help me to deploy to heroku with Github. Thanks in advance.

Here is my code:

Procfile:

 web: node index.js

Index.js:

var express = require('express');
var app = express();
var path = require('path');
var http = require('http').Server(app);
var io = require('socket.io')(http);

var routes = require('./routes');
var chats = require('./chat');



app.use(express.static(path.join(__dirname, '../public')));

routes.load(app);
chats.load(io);


// app.listen(process.env.PORT || 5000, function () {
//     console.log('Express server listening....', process.env.PORT);
// });


http.listen(3000, function () {
  console.log('listening on *:3000');
}); 



via Billy Jr.

No comments:

Post a Comment