Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
import BookBrainzData from 'bookbrainz-data';
import config from '../config/test.json';
const orm = BookBrainzData(config.database);
// opens up database connection for later use in tests
export default orm;
import config from '../common/helpers/config';
import express from 'express';
import initRoutes from './routes';
import logger from 'morgan';
import redis from 'connect-redis';
import session from 'express-session';
Promise.config({
longStackTraces: true,
warnings: true
});
// Initialize application
const app = express();
app.locals.orm = BookBrainzData(config.database);
app.set('trust proxy', config.site.proxyTrust);
if (app.get('env') !== 'testing') {
app.use(logger('dev'));
}
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(compression());
const RedisStore = redis(session);
import logger from 'morgan';
import path from 'path';
import redis from 'connect-redis';
import routes from './routes';
import serveStatic from 'serve-static';
import session from 'express-session';
Promise.config({
longStackTraces: true,
warnings: true
});
// Initialize application
const app = express();
app.locals.orm = BookBrainzData(config.database);
const rootDir = path.join(__dirname, '../../');
app.set('trust proxy', config.site.proxyTrust);
app.use(favicon(path.join(rootDir, 'static/images/icons/favicon.ico')));
if (app.get('env') !== 'testing') {
app.use(logger('dev'));
}
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
}));
app.use(compression());