<commit_before>'use strict'

var config = require('./config') //either js: 'module.exports = {}' or json: '{}'
var express = require('express')

var app = express()
app.use(express.static(__dirname + '/public/'))
app.get(/^(.*)$/, function(req, res, next) {
  return res.sendfile(__dirname + '/public/query.htm')
})

app.listen(config.port)
console.log('now listening to port', config.port)

<commit_msg>serve the page only on valid gist ids<commit_after>'use strict'

var config = require('./config') //either js: 'module.exports = {}' or json: '{}'
var express = require('express')

var validGistIdPathRegex = /^\/(\d+|[\da-f]{20})$/

var app = express()
app.use(express.static(__dirname + '/public/'))
app.get(validGistIdPathRegex, function(req, res, next) {
  return res.sendfile(__dirname + '/public/query.htm')
})

// Add error on invalid paths

app.listen(config.port)
console.log('now listening to port', config.port)


{'fraction_non_alphanumeric': 0.19201725997842503, 'fraction_numerical': 0.002157497303128371, 'mean_word_length': 4.728395061728395, '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': '6279456', 'n_tokens_mistral': 311, 'n_tokens_neox': 302, 'n_words': 77}