<commit_before>var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var methodOverride = require("method-override");
var app = express();
var path = require('path');

// Connection to DB
var db;
mongoose.connect('mongodb://localhost/bordesa', function(err, res) {
 if(err) throw err;
db = res;
 console.log('Connected to Database');
});

// Middlewares

app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json()); 


// Import Models and Controllers
var models = require('./models/client')(app, mongoose);
var modelSeller = require('./models/seller')(app, mongoose);
var modelsTecnica = require('./models/tecnica')(app, mongoose);
var modelProduct = require('./models/product')(app, mongoose);
var modelOrder = require('./models/order')(app, mongoose);
var modelTecnicaCotizacion = require('./models/tecnicaCotizacion')(app, mongoose);
var modelProductCotizacion = require('./models/productCotizacion')(app, mongoose);
var modelOrder = require('./models/order')(app, mongoose);


var ClientCtrl = require('./controllers/client');
var OrderCtrl = require('./controllers/order');
var TecnicaCtrl = require('./controllers/tecnica');
var ProductCtrl = require('./controllers/product');
var SellerCtrl = require('./controllers/seller');

// API routes
var api = express.Router();

api.route('/clients') 
 .get(ClientCtrl.findAll)
 .post(ClientCtrl.add);

api.route('/clients/:id') 
 .get(ClientCtrl.findById)
 .put(ClientCtrl.update)
 .delete(ClientCtrl.delete);


api.route('/orders') 
 .get(OrderCtrl.findAll)
 .post(OrderCtrl.add);

api.route('/orders/:id') 
 .get(OrderCtrl.findById)
 .put(OrderCtrl.update)

api.route('/tecnicas') 
 .get(TecnicaCtrl.findAll)<commit_msg>server.js<commit_after>var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var methodOverride = require("method-override");
var app = express();
var path = require('path');
var __projectRoot = __dirname + '/../';

// Connection to DB
var db;
mongoose.connect('mongodb://localhost/bordesa', function(err, res) {
 if(err) throw err;
db = res;
 console.log('Connected to Database');
});

// Middlewares

app.use(bodyParser.urlencoded({extended: false}))
app.use(bodyParser.json());
app.use(methodOverride());
app.use(express.static(__projectRoot));


// Import Models and Controllers
var models = require('./models/client')(app, mongoose);
var modelSeller = require('./models/seller')(app, mongoose);
var modelsTecnica = require('./models/tecnica')(app, mongoose);
var modelProduct = require('./models/product')(app, mongoose);
var modelOrder = require('./models/order')(app, mongoose);
var modelTecnicaCotizacion = require('./models/tecnicaCotizacion')(app, mongoose);
var modelProductCotizacion = require('./models/productCotizacion')(app, mongoose);
var modelOrder = require('./models/order')(app, mongoose);


var ClientCtrl = require('./controllers/client');
var OrderCtrl = require('./controllers/order');
var TecnicaCtrl = require('./controllers/tecnica');
var ProductCtrl = require('./controllers/product');
var SellerCtrl = require('./controllers/seller');
var router = express.Router();
// Index - Route
app.route('/*').get(function(req, res) { 
    return res.sendFile(path.join(__projectRoot, 'index.html')); 
});

app.use(router);

// API routes
var api = express.Router();

api.route('/clients') 
 .get(ClientCtrl.findAll)
 .post(ClientCtrl.add);

api.route('/clients/:id') 
 .get(ClientCtrl.findById)
 .put(ClientCtrl.update)
 .delete(ClientCtrl.delete);


api.route('/orders') 
 .get(OrderCtrl.findAll)
 .post(OrderCtrl.add);

api.route('/orders/:id') 
 .get(OrderCtrl.findById)
 .put(OrderCtrl.update)

api.route('/tecnicas') 
 .get(TecnicaCtrl.findAll)
{'fraction_non_alphanumeric': 0.18297533810660302, 'fraction_numerical': 0.0, 'mean_word_length': 5.6643109540636045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7422234', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1217, 'n_words': 233}