<commit_before>const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const sassMiddleware = require('node-sass-middleware')
const appDir = path.dirname(require.main.filename)

module.exports = {
	PORT: 3000,
	VIEWS: './views/pug',
	ENGINE: 'pug',
	app: express(),

	serve: function() {
		this.app.set('port', this.PORT)
		this.app.set('views', this.VIEWS)
		this.app.set('view engine', this.ENGINE)

		this.app.use(sassMiddleware({
				src: appDir + '/views/scss',
				dest: appDir + '/public/css',
				prefix: '/css',
				indentedSyntax: false,
				debug: true,
			})
		)

		// Serve files other than compiled pug markup:
		this.app.use(express.static(path.join(__dirname, '../public')))

		this.app.get('/', function(req, res) {
			res.render('index', { title: 'Tarchivebot', message: 'Welcome' })
		})

		// Body parser for API
		this.app.use(bodyParser.urlencoded({ extended: false }))

		var server = this.app.listen(this.app.get('port'), function() {
			var port = server.address().port
			console.log(__filename + ':\tServing static files from ./public to  localhost:' + port)
		})
	}
}
<commit_msg>API now accepting JSON format instead of form encoded data<commit_after>const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const sassMiddleware = require('node-sass-middleware')
const appDir = path.dirname(require.main.filename)

module.exports = {
	PORT: 3000,
	VIEWS: './views/pug',
	ENGINE: 'pug',
	app: express(),

	serve: function() {
		this.app.set('port', this.PORT)
		this.app.set('views', this.VIEWS)
		this.app.set('view engine', this.ENGINE)

		this.app.use(sassMiddleware({
				src: appDir + '/views/scss',
				dest: appDir + '/public/css',
				prefix: '/css',
				indentedSyntax: false,
				debug: true,
			})
		)

		// Serve files other than compiled pug markup:
		this.app.use(express.static(path.join(__dirname, '../public')))

		this.app.get('/', function(req, res) {
			res.render('index', { title: 'Tarchivebot', message: 'Welcome' })
		})

		// Body parser for API
		this.app.use(bodyParser.json())

		var server = this.app.listen(this.app.get('port'), function() {
			var port = server.address().port
			console.log(__filename + ':\tServing static files from ./public to  localhost:' + port)
		})
	}
}

{'fraction_non_alphanumeric': 0.1742294520547945, 'fraction_numerical': 0.003424657534246575, 'mean_word_length': 3.818556701030928, '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': '6566299', 'n_tokens_mistral': 886, 'n_tokens_neox': 785, 'n_words': 179}