I was not successful in opening the app on my browser using the new version of CBtracker, but replacing the code of app.js from the old version does the trick. The code below was only extracted from the old CBTRACKER version so it will work locally. My solution - at least for local version of CBtracker is:
- Backup app.js, and open app.js with Notepad.
- Replace everything with the code below. For transparency, you can audit the code below for your reference.
`const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
const logger = require('morgan');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const app = express();
const debug = require('debug')('myapp:app');
// config
const config = require('./config/config');
// database config
// const db = require('./config/db');
// view engine setup
app.set('views', path.join(__dirname, 'app/views'));
app.set('view engine', 'pug');
app.use(logger(config.isProd ? 'combined' : 'dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(favicon(path.join(__dirname, 'public', 'favicon/favicon.ico')));
app.use(express.static(path.join(__dirname, 'public')));
// bootstrap routes
require('./app/routes')(app);
// catch 404 and forward to error handler
app.use((req, res, next) => {
const err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use((err, req, res, next) => {
// set locals, only providing error in development
res.locals.message = err.message; // eslint-disable-line no-param-reassign
res.locals.error = config.isDev ? err : {}; // eslint-disable-line no-param-reassign
// render the error page
res.status(err.status || 500);
res.render('error');
});
// db.on('connected', () => {
app.listen(config.server.port, () => {
debug(App listening on port: ${config.server.port}
);
app.emit('appStarted');
});
// });
module.exports = app;`
I only know little programming. I hope this gives an idea to help those who are installing the tracker locally. Thank you so much! More power to you! Donating again in a few minutes.