{"size": 1111, "ext": "js", "max_stars_repo_path": "Server/app.js", "max_stars_repo_name": "ampzord/FEUP-CMOV-Supermarket", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Server/app.js", "max_issues_repo_name": "ampzord/FEUP-CMOV-Supermarket", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Server/app.js", "max_forks_repo_name": "ampzord/FEUP-CMOV-Supermarket", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.0975609756, "max_line_length": 60, "alphanum_fraction": 0.701170117}
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var cryp = require('./crypto_utils');
const { generateKeyPairSync } = require('crypto');
const { writeFileSync, fs } = require('fs');

//const uuid = require('uuid/v4')
//const session = require('express-session')

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var transactionsRouter = require('./routes/transactions');

var app = express();

//only runs once for the keys only need to be generated once
//cryp.generateKeys();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');

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

app.use('/', indexRouter);

//Server and user communication
app.use('/api', usersRouter); //register
app.use('/api', transactionsRouter); //register



module.exports = app;
