M
M
MifeeX2020-04-02 20:27:14
JavaScript
MifeeX, 2020-04-02 20:27:14

Why is node.js not working on hosting?

Good afternoon!
I'm trying to upload node.js applications to best-hoster's servers. However, when I try to click on the "Fatigue npm packages" button, a 500 error pops up ... I looked at the logs, the error comes from the lines below:

app.set('views', path.join(__dirname, 'views'));
app.engine('hbs', expressHsb({defaultLayout: 'layout',
extname: 'hbs', layoutsDir: __dirname + '/views/layouts/'}))
app.set('view engine', 'hbs');

app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));

and from modules
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
var Cart = require('./routes/cart');

How to deal with this and how to fix it?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question