<commit_before>var express = require("express"),
    httpProxy = require("http-proxy"),
    proxy = httpProxy.createProxyServer({}),
    app = express(),
    compression = require("compression"),
    open = require("open"),
    serveIndex = require("serve-index"),
    port = 8081,
    publicPath = "/app",
    directory = __dirname,
    launchUrl = "http://localhost:" + port + publicPath,
    year = 60 * 60 * 24 * 365 * 1000;
    
// use compress middleware to gzip content
app.use(compression());

// set default mime type to xml for ".library" files
express.static.mime.default_type = "text/xml";

// serve up content directory showing hidden (leading dot) files
app.use(publicPath, express.static(directory, { maxAge: year, hidden: true }));

// enable directory listing
app.use("/app", serveIndex(__dirname, {"icons": true}));
app.use("/gui", function(req,res) {
    for(var prop in req.headers) {
        if(req.headers.hasOwnProperty(prop)) {
            if(prop !== "authorization" && prop !== "cookie") {
                delete req.headers[prop];
            }
        }
    }
    
    proxy.web(req, res, { target: "http://localhost:9002/gui" + req.url.toString() });
});

// start server
app.listen(port);

// launch uri in default browser
open(launchUrl);

// log to server console
console.log("OpenUI5 SDK server running at\n  => " + launchUrl + " \nCTRL + C to shutdown")<commit_msg>Changes to server.js and added package.json<commit_after>var express = require("express"),
    http = require("http"),
    app = express(),
    compression = require("compression"),
    //open = require("open"),
    serveIndex = require("serve-index"),
    port = process.env.OPENSHIFT_NODEJS_PORT|| 8081,
	host = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1',
    publicPath = "/app",
    directory = __dirname,
    launchUrl = "http://" + host + ":" + port + publicPath,
    year = 60 * 60 * 24 * 365 * 1000;
    
// use compress middleware to gzip content
app.use(compression());

// set default mime type to xml for ".library" files
express.static.mime.default_type = "text/xml";

// serve up content directory showing hidden (leading dot) files
app.use(publicPath, express.static(directory, { maxAge: year, hidden: true }));

// enable directory listing
app.use("/", serveIndex(__dirname, {"icons": true}));
app.use("/gui", function(req, res) {
    for(var prop in req.headers) {
        if(req.headers.hasOwnProperty(prop)) {
            if(prop !== "authorization" && prop !== "cookie") {
                delete req.headers[prop];
            }
        }
    }
    
	http.request({
		host: "grifonpc.ddns.net",
		port: 9002,
		path: "/gui" + req.url.toString(),
		headers: {
			"Authorization" : req.headers.authorization,
			"Cookie" : req.headers.cookie
		}
	}, function(innerRes) {
		innerRes.on('data', function (data) {
			res.write(data);
			res.end();
		});
	});
	
    //proxy.web(req, res, { target: "http://grifonpc.ddns.net:9002/gui" + req.url.toString() });
});

// start server
app.listen(port, host);

// launch uri in default browser
//open(launchUrl);

// log to server console
console.log("OpenUI5 SDK server running at\n  => " + launchUrl + " \nCTRL + C to shutdown")
{'fraction_non_alphanumeric': 0.1654653713569414, 'fraction_numerical': 0.016922594797869006, 'mean_word_length': 3.15625, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 1, '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': '4582183', 'n_tokens_mistral': 1055, 'n_tokens_neox': 991, 'n_words': 252}