<commit_before>'use strict';
var _ = require('lodash');

var gulpServerStart = function (options) {
	var serverOptions = {
		data: 'db.json',
		port: 3000,
		rewriteRules: null,
		baseUrl: null
	};

	_.assign(serverOptions, options || {});

	var jsonServer = require('json-server');
	var server = jsonServer.create();

	server.use(jsonServer.defaults);

	if(serverOptions.rewriteRules){
		server.use(jsonServer.rewriter(serverOptions.rewriteRules));
	}
	
	var router = jsonServer.router(serverOptions.data);
	if(serverOptions.baseUrl) {
		server.use(serverOptions.baseUrl, router);
	}
	else{
		server.use(router);
	}

	return server.listen(serverOptions.port);
};

module.exports = {
	start: gulpServerStart
};<commit_msg>i had forget the main change...<commit_after>'use strict';
var _ = require('lodash');

var gulpServerStart = function (options) {
	var serverOptions = {
		data: 'db.json',
		port: 3000,
		rewriteRules: null,
		baseUrl: null,
		id:'_id'
	};

	_.assign(serverOptions, options || {});

	var jsonServer = require('json-server');
	var server = jsonServer.create();

	server.use(jsonServer.defaults);

	if(serverOptions.rewriteRules){
		server.use(jsonServer.rewriter(serverOptions.rewriteRules));
	}
	
	var router = jsonServer.router(serverOptions.data);
	if(serverOptions.baseUrl) {
		server.use(serverOptions.baseUrl, router);
	}
	else{
		server.use(router);
	}
	
	if(serverOptions.id)
		router.db._.id = serverOptions.id;

	return server.listen(serverOptions.port);
};

module.exports = {
	start: gulpServerStart
};
{'fraction_non_alphanumeric': 0.1472312703583062, 'fraction_numerical': 0.005211726384364821, 'mean_word_length': 4.862595419847328, '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': '5717879', 'n_tokens_mistral': 558, 'n_tokens_neox': 515, 'n_words': 93}