<commit_before>require! <[jsonfile body-parser]>

module.exports =
  init: (server) !->
    jsonfile.spaces = 4
    @app = server
    @app.use bodyParser.json!
    @app.use bodyParser.urlencoded {+extended}

  getEvent: !->
    event = jsonfile.readFileSync \event.json
    @app.get \/loadEvent (req, res) !->
      res.send event
      res.end!

  sendReply: !->
    @app.post \/writeReply (req, res) !->
      json-ary = jsonfile.readFileSync \comment.json
      json-ary.push req.body
      jsonfile.writeFileSync \comment.json, json-ary
      res.send json-ary



# vi:et:ft=ls:nowrap:sw=2:ts=2
<commit_msg>set backend timeout<commit_after>require! <[jsonfile body-parser]>

module.exports =
  init: (server) !->
    jsonfile.spaces = 4
    @app = server
    @app.use bodyParser.json!
    @app.use bodyParser.urlencoded {+extended}

  getEvent: !->
    event = jsonfile.readFileSync \event.json
    @app.get \/loadEvent (req, res) !->
      res.send event
      res.end!

  sendReply: !->
    @app.post \/writeReply (req, res) !->
      json-ary = jsonfile.readFileSync \comment.json
      json-ary.push req.body
      jsonfile.writeFileSync \comment.json, json-ary
      setTimeout ->
        res.send json-ary
      , 3000



# vi:et:ft=ls:nowrap:sw=2:ts=2

{'fraction_non_alphanumeric': 0.14489311163895488, 'fraction_numerical': 0.00791765637371338, 'mean_word_length': 2.590909090909091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '438953', 'n_tokens_mistral': 469, 'n_tokens_neox': 449, 'n_words': 88}