<commit_before>var express = require('express'),
  app = express(),
  port = process.env.PORT || 3000,
  stylus = require('stylus'),
  nib = require('nib');

// how do we handle requests and parse the request body
var bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// these set static exposures for media files and pictures and such
app.use(express.static('static'));
app.use(express.static('modules'));
app.use(express.static('views'));
app.use(express.static('/data'));

// these settings are made available via app.get('variable name')
// from within all subsequent scripts

// set server address
app.set('svrProto', 'http');
app.set('svrAddr', 'DeepThought');
app.set('svrPort', Number(3000));
app.set('svrApi', '/api/v1');
app.set('svrUrl', '/tags');

// this is for the second node.js app, that does the actual file uploading
app.set('fileServiceProto', 'http');
app.set('fileServiceAddr', 'DeepThought');
app.set('fileServicePort', Number(3001));
app.set('fileServiceApi', '/api/v1');
app.set('fileServiceUrl', '/file');

// this is for the thrid node.js app, that does the actual audio playback
app.set('playerProto', 'http');
app.set('playerAddr', 'DeepThought');
app.set('playerPort', Number(3002));
app.set('playerApi', '/api/v1');
app.set('playerUrl', '/player');

// this is for the 4th node.js app, that does the actual audio playback
app.set('rfidReaderProto', 'http');
app.set('rfidReaderAddr', 'DeepThought');
app.set('rfidReaderPort', Number(3003));
app.set('rfidReaderApi', '/api/v1');
app.set('rfidReaderUrl', '/rfid');


// and a rather ugly global DEBUG switch
app.set('DEBUG', true);
// plus another also very ugly TRACE switch
app.set('TRACE', true);

app.set('/img', express.static('/static/img'));
app.set('/Media', express.static('/data/Media'));

// this is the path to the file system where the rfid tags are stored
app.set('rfidTagDir', '/data/TagDB');
app.set('MediaDir', '/data/Media');

// settings for the template engine pug
app.set('/views', express.static('/views'));
app.set('view engine', 'pug');


// set the routes for different part of the application
var appRoutes = require("./routes/routes_app.js")(app);
var tagRoutes = require("./routes/routes_tags.js")(app);
//var rfidRoutes = require("./routes/routes_rfid.js")(app);
//var playerRoutes = require("./routes/routes_player.js")(app);

var svrProto = app.get('svrProto');
var svrAddr = app.get('svrAddr');<commit_msg>still broken exposure of media and tag files<commit_after>var express = require('express'),
  app = express(),
  port = process.env.PORT || 3000,
  stylus = require('stylus'),
  nib = require('nib');

// how do we handle requests and parse the request body
var bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// these set static exposures for media files and pictures and such
app.use(express.static('static'));
app.use(express.static('modules'));
app.use(express.static('views'));
app.use(express.static('/data'));

// these settings are made available via app.get('variable name')
// from within all subsequent scripts

// set server address
app.set('svrProto', 'http');
app.set('svrAddr', 'DeepThought');
app.set('svrPort', Number(3000));
app.set('svrApi', '/api/v1');
app.set('svrUrl', '/tags');

// this is for the second node.js app, that does the actual file uploading
app.set('fileServiceProto', 'http');
app.set('fileServiceAddr', 'DeepThought');
app.set('fileServicePort', Number(3001));
app.set('fileServiceApi', '/api/v1');
app.set('fileServiceUrl', '/file');

// this is for the thrid node.js app, that does the actual audio playback
app.set('playerProto', 'http');
app.set('playerAddr', 'DeepThought');
app.set('playerPort', Number(3002));
app.set('playerApi', '/api/v1');
app.set('playerUrl', '/player');

// this is for the 4th node.js app, that does the actual audio playback
app.set('rfidReaderProto', 'http');
app.set('rfidReaderAddr', 'DeepThought');
app.set('rfidReaderPort', Number(3003));
app.set('rfidReaderApi', '/api/v1');
app.set('rfidReaderUrl', '/rfid');


// and a rather ugly global DEBUG switch
app.set('DEBUG', true);
// plus another also very ugly TRACE switch
app.set('TRACE', true);

app.set('/img', express.static('/static/img'));
app.set('/Media', express.static('/data/Media'));
app.set('/TagDB', express.static('/data/TagDB'));

// this is the path to the file system where the rfid tags and Media Files are stored
app.set('rfidTagDir', '/data/TagDB');
app.set('MediaDir', '/data/Media');

// settings for the template engine pug
app.set('/views', express.static('/views'));
app.set('view engine', 'pug');


// set the routes for different part of the application
var appRoutes = require("./routes/routes_app.js")(app);
var tagRoutes = require("./routes/routes_tags.js")(app);
//var rfidRoutes = require("./routes/routes_rfid.js")(app);
//var playerRoutes = require("./routes/routes_player.js")(app);

var svrProto = app.get('svrProto');
var svrAddr = app.get('svrAddr');
{'fraction_non_alphanumeric': 0.19091806515301085, 'fraction_numerical': 0.009871668311944718, 'mean_word_length': 5.364321608040201, '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': '1960128', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1637, 'n_words': 445}