<commit_before>var express = require('express')
var http = require('http')
var bodyParser = require('body-parser')

var app = express()
var server = http.createServer(app)

var port = 8700

console.log("Starting Node Server on port " + port)

server.listen(port)

app.use(bodyParser.json())
app.use(express.static('public'))

app.post('/update', function (req, res) {
	console.log(req.body)
	res.send('ok')
})<commit_msg>Add control with pi-blaster<commit_after>"use strict";

var express = require('express')
var http = require('http')
var bodyParser = require('body-parser')
var blaster = require('pi-blaster.js')

var app = express()
var server = http.createServer(app)

var port = 8700

var strips = [
	{ red: 17, green: 27, blue: 22 }
]

console.log("Starting Node Server on port " + port)

server.listen(port)

app.use(bodyParser.json())
app.use(express.static('public'))

app.post('/update', function (req, res) {
	var data = req.body

	if (data.strip > strips.length - 1) {
		res.status(400).send("Strip #" + data.strip + " does not exist.")
		return
	}

	blaster.setPwm(strips[data.strip].red, data.red / 255)
	blaster.setPwm(strips[data.strip].green, data.green / 255)
	blaster.setPwm(strips[data.strip].blue, data.blue / 255)

	res.send('ok')
})
{'fraction_non_alphanumeric': 0.17038216560509553, 'fraction_numerical': 0.021496815286624203, 'mean_word_length': 4.6877828054298645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2693922', 'n_tokens_mistral': 474, 'n_tokens_neox': 440, 'n_words': 103}