<commit_before>const express = require('express');
const Q = require('Q')
const router = express.Router();
const winston = require('winston')
const utils = require('../utilities.js')
const messageManager = require('../bin/message-manager/message-manager')

router.get('/', function (req, res, next) {
  

  // If the GET param 'offset' is supplied, use it. Otherwise, use 0.
  let offset = req.query.offset == {} ? 0 : req.query.offset

  utils.verifyNumberIsInteger(offset)
    .then(function (offset) {
      return messageManager.getHundredMessageIds(offset)
    })
    .then(function (rows) {<commit_msg>Fix bug where behaviour was incorrect for GET/messages without offset supplied<commit_after>const express = require('express');
const Q = require('Q')
const router = express.Router();
const winston = require('winston')
const utils = require('../utilities.js')
const messageManager = require('../bin/message-manager/message-manager')

router.get('/', function (req, res, next) {
  

  // If the GET param 'offset' is supplied, use it. Otherwise, use 0.
  let offset = (req.query.offset == undefined ? 0 : req.query.offset)

  utils.verifyNumberIsInteger(offset)
    .then(function (offset) {
      return messageManager.getHundredMessageIds(offset)
    })
    .then(function (rows) {
{'fraction_non_alphanumeric': 0.1449612403100775, 'fraction_numerical': 0.0031007751937984496, 'mean_word_length': 4.205645161290323, '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': '306540', 'n_tokens_mistral': 381, 'n_tokens_neox': 372, 'n_words': 105}