<commit_before>var fs = require('fs');
var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var pjson = require('./package.json');
var app = express();

var webgpioreact = exports;

const PUBLIC_PATH = path.join(__dirname, '../public');
const JSON_PATH = path.join(PUBLIC_PATH,"json");


//CORS middleware
var allowCrossDomain = function(req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');

    next();
}

webgpioreact.start = function() {

	app.set('port', (process.env.PORT || 3000));

	app.use('/', express.static(PUBLIC_PATH));
	app.use(allowCrossDomain);

	app.get('/boards', function(req, res) {
		var file = fs.readFileSync(path.join(JSON_PATH,"/boards/boards.json"), "UTF-8");
    	res.send(JSON.parse(file));
	});

	app.get("/boards/:boardName", function(req, res) {
    	var boardName = req.params.boardName;
    	var file = fs.readFileSync(path.join(JSON_PATH,"/boards/" + boardName + ".json"), "UTF-8");
		res.send(JSON.parse(file));
	});


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

	app.listen(app.get('port'), function() {

		
	var version = pjson.version;

	  console.log('web-gpio-react server v' + version + ' started: http://localhost:' + app.get('port') + '/');
	});

}<commit_msg>removed package.json dependency (heroku issue)<commit_after>var fs = require('fs');
var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
//var pjson = require('./package.json');
var app = express();

var webgpioreact = exports;

const PUBLIC_PATH = path.join(__dirname, '../public');
const JSON_PATH = path.join(PUBLIC_PATH,"json");


//CORS middleware
var allowCrossDomain = function(req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');

    next();
}

webgpioreact.start = function() {

	app.set('port', (process.env.PORT || 3000));

	app.use('/', express.static(PUBLIC_PATH));
	app.use(allowCrossDomain);

	app.get('/boards', function(req, res) {
		var file = fs.readFileSync(path.join(JSON_PATH,"/boards/boards.json"), "UTF-8");
    	res.send(JSON.parse(file));
	});

	app.get("/boards/:boardName", function(req, res) {
    	var boardName = req.params.boardName;
    	var file = fs.readFileSync(path.join(JSON_PATH,"/boards/" + boardName + ".json"), "UTF-8");
		res.send(JSON.parse(file));
	});


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

	app.listen(app.get('port'), function() {

		
	var version = "0.0.1" // pjson.version; // does not work on heroku.

	  console.log('web-gpio-react server v' + version + ' started: http://localhost:' + app.get('port') + '/');
	});

}
{'fraction_non_alphanumeric': 0.20486815415821502, 'fraction_numerical': 0.005070993914807302, 'mean_word_length': 4.51024208566108, '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': '3655366', 'n_tokens_mistral': 1045, 'n_tokens_neox': 993, 'n_words': 180}