totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

I don't know how to configure my application on the heroku server #760

Closed AlbertoCime14 closed 4 years ago

AlbertoCime14 commented 4 years ago

I uploaded the application to heroku server, however I can't make it work, I don't know how to configure the environment variables that the application requires in heroku

this is my Procfile file web: node debug.js

this is my package.json { "name": "Eshop", "description": "A simple and powerful Eshop solution written in Total.js / Node.js.", "version": "11.0.0", "main": "release.js", "repository": { "type": "git", "url": "https://github.com/totaljs/eshop" }, "dependencies": { "express": "^4.17.1", "paypal-express-checkout": "^1.6.3", "total.js": "^3.4.4" }, "scripts": { "start": "node debug.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "eshop", "ecommerce" ], "author": "Peter Širka", "license": "MIT" }

this is my debug.js

`// ===================================================
// FOR DEVELOPMENT
// Total.js - framework for Node.js platform
// https://www.totaljs.com
// ===================================================
//async function main(){
// await a
//}
var options = {};
options.port = 5000;

// options.ip = '127.0.0.1';
// options.port = parseInt(process.argv[2]);
// options.config = { name: 'Total.js' };
// options.sleep = 3000;
// options.inspector = 9229;
// options.watch = ['private'];

require('total.js/debug')(options);`

this is my config file :

name                      : Mérida en línea
version                   : 11.0.0
author                    : Peter Širka

// Hidden super admin in the form username:password
admin-superadmin          : admin:admin
admin-cookie              : __admin

// Enables real-time visitor tracking
admin-tracking            : true

// Image convertor for resizing of pictures
// Default image converter: im = ImageMagick, gm = GraphicsMagick
default-image-converter   : gm

// Default theme
default-theme             : default

this is the error I get with the heroku logs command:

2020-07-18T21:09:46.897638+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2020-07-18T21:09:46.916891+00:00 heroku[web.1]: Stopping process with SIGKILL 2020-07-18T21:09:46.970044+00:00 heroku[web.1]: Process exited with status 137 2020-07-18T21:09:47.009886+00:00 heroku[web.1]: State changed from starting to crashed 2020-07-19T03:08:03.606474+00:00 heroku[web.1]: State changed from crashed to starting 2020-07-19T03:08:06.885322+00:00 heroku[web.1]: Starting process with command node debug.js 2020-07-19T03:08:09.299623+00:00 app[web.1]: > DEBUG PID: 4 (v3.4.4)

please help me! thank you

petersirka commented 4 years ago

Recommendation: Instead of Heroku use Total.js Cloud (there you have everything and good price).

AlbertoCime14 commented 4 years ago

I've already tried that setup but it doesn't work.

In the config-release file I added:

default-ip                     : auto
default-port                   : auto
default-image-converter        : im

and change this in debug.js but it doesn't work either

// ===================================================
// FOR DEVELOPMENT
// Total.js - framework for Node.js platform
// https://www.totaljs.com
// ===================================================
//async function main(){
//  await a
//}
var options = {};
//options.port = 5000;

// options.ip = '127.0.0.1';
// options.port = parseInt(process.argv[2]);
// options.config = { name: 'Total.js' };
// options.sleep = 3000;
// options.inspector = 9229;
// options.watch = ['private'];

require('total.js/debug')(options);

for this:

// ===================================================
// FOR PRODUCTION
// Total.js - framework for Node.js platform
// https://www.totaljs.com
// ===================================================

const options = {};

// options.ip = '127.0.0.1';
// options.port = parseInt(process.argv[2]);
// options.config = { name: 'Total.js' };
// options.sleep = 3000;

require('total.js').http('release', options);
// require('total.js').cluster.http(5, 'release', options);