<commit_before>var app = require('express')();
var path = require('path');
var fs = require('fs');
var upload = require('multer')({
	dest: path.resolve( '../../../Destination/uploads' ),
	limits: {
		fileSize: 2*1024*1024
	}
});
var vision = require('@google-cloud/vision')({
	projectId: 'facespielen',
	keyFilename: path.resolve('keyfile.json')
});

app.get( '/' , function ( req , res ) {
	res.sendFile( path.resolve( '../public/index.html' ) );
});

app.post ( '/run', upload.single("photo"), function ( req, res ) {

	console.log('Загрузка файла: ', req.file.path);

	vision.detectFaces( 
		path.resolve( '../../../Destination/uploads/'+req.file.filename ),
		function ( err, faces ) {
			if (err) {
				console.log('Ошибка определения лиц: ', err);
			} else {

				console.log('Лица определены: ', faces);

				res.send({
					success: true
				})
			}
		}
	);
});

app.listen( 8097, function () {
	console.log( 'Server started!' );
});<commit_msg>webApp<commit_after>var app = require('express')();
var path = require('path');
var fs = require('fs');
var upload = require('multer')({
	dest: path.resolve( '../../Destination/uploads' ),
	limits: {
		fileSize: 2*1024*1024
	}
});
var vision = require('@google-cloud/vision')({
	projectId: 'facespielen',
	keyFilename: path.resolve('keyfile.json')
});

app.get( '/' , function ( req , res ) {
	res.sendFile( path.resolve( '../public/index.html' ) );
});

app.post ( '/run', upload.single("photo"), function ( req, res ) {

	console.log('Загрузка файла: ', req.file.path);

	vision.detectFaces( 
		path.resolve( '../../Destination/uploads/'+req.file.filename ),
		function ( err, faces ) {
			if (err) {
				console.log('Ошибка определения лиц: ', err);
			} else {

				console.log('Лица определены.');

				fs.writeFile( 
					path.resolve( '../../Destination/json/'+req.file.filename ),
					JSON.stringify(faces),
					function (err) {

						if (err) {
							console.log( 'Ошибка записи JSON-файла: ', err );
						} else {

							res.send({
								success: true
							});
						}
					}
				);
			}
		}
	);
});

app.listen( 8097, function () {
	console.log( 'Server started!' );
});
{'fraction_non_alphanumeric': 0.2125874125874126, 'fraction_numerical': 0.012121212121212121, 'mean_word_length': 3.095419847328244, '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': '3345532', 'n_tokens_mistral': 887, 'n_tokens_neox': 776, 'n_words': 145}