<commit_before>import express from 'express'
import parser from 'body-parser'
import config from '../config.json'
import Dispatcher from './Dispatcher.js'
import path from 'path'
import API from './Api.js'

export default function server() {
  let app = express(),
    dispatcher = new Dispatcher(path.join(__dirname, '..', 'public')),
    api = new API(config["api_key"])
  
  app.use(express.static('public'))

  app.get("/", (req, res) => {
    dispatcher.sendFile(res, 'index.html')
  })

  let jsonParser = parser.json()

  app.post("/status", jsonParser, (req, res) => {
    dispatcher.json(res, api.getStatusShardsRegion(req.body.region))
  })

  app.post("/summoner-by-name", jsonParser, (req, res) => {
    dispatcher.json(res, api.getSummonerByName(
      req.body.region,
      req.body.q
    ))
  })

  app.post("/summoner-sumary", jsonParser, (req, res) => {
    dispatcher.json(res, api.getSummary(
      req.body.region, req.body.summoner, req.body.season
    ))
  })

  app.post("/summoner-ranked", jsonParser, (req, res) => {
    dispatcher.json(res, api.getRanked(
      req.body.region, req.body.summoner, req.body.season
    ))
  })

  app.post("/champions", jsonParser, (req, res) => {
    dispatcher.json(res, api.getChampions(req.body.region))
  })
  
  return app
}<commit_msg>combine bodyParser<commit_after>import express from 'express'
import parser from 'body-parser'
import config from '../config.json'
import Dispatcher from './Dispatcher.js'
import path from 'path'
import API from './Api.js'

export default function server() {
  let app = express(),
    dispatcher = new Dispatcher(path.join(__dirname, '..', 'public')),
    api = new API(config["api_key"])
  
  app.use(express.static('public'))
  app.use(parser.json())

  app.get("/", (req, res) => {
    dispatcher.sendFile(res, 'index.html')
  })

  app.post("/status", (req, res) => {
    dispatcher.json(res, api.getStatusShardsRegion(req.body.region))
  })

  app.post("/summoner-by-name", (req, res) => {
    dispatcher.json(res, api.getSummonerByName(
      req.body.region,
      req.body.q
    ))
  })

  app.post("/summoner-sumary", (req, res) => {
    dispatcher.json(res, api.getSummary(
      req.body.region, req.body.summoner, req.body.season
    ))
  })

  app.post("/summoner-ranked", (req, res) => {
    dispatcher.json(res, api.getRanked(
      req.body.region, req.body.summoner, req.body.season
    ))
  })

  app.post("/champions", (req, res) => {
    dispatcher.json(res, api.getChampions(req.body.region))
  })
  
  return app
}
{'fraction_non_alphanumeric': 0.17848699763593381, 'fraction_numerical': 0.0, 'mean_word_length': 3.377586206896552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5469402', 'n_tokens_mistral': 908, 'n_tokens_neox': 889, 'n_words': 168}