<commit_before>express = require "express"
jade = require "jade"
fs = require "fs"

class Bootstrap
  _self = undefined
  routes:
    DEFAULT_PATH: "/"
    TEMPLATE_PATH: "/load/:view"
    DIRECTIVE_PATH: "/directive/:template"
  options:
    templatePath: "#{__dirname}/../src/templates"
    isDev: "#{__dirname}/../dev"
    contentPath: "#{__dirname}/../frontend"
    libraryPath: "#{__dirname}/../bower_components"
    port: 8080
    status:
      notFound: 404
  isDev: undefined

  constructor: ->
    _self = @
    @isDev = fs.existsSync @options.isDev
    @app = express()

    @app.use "/frontend", express.static(@options.contentPath)
    @app.use "/bower_components", express.static(@options.libraryPath)
    @app.set "views", @options.templatePath
    @app.set "view engine", "jade"
    @app.engine "jade", jade.__express

    @app.get @routes.DEFAULT_PATH, (request, response)->
      appData =
        data:
          isDev: _self.isDev
      response.render "index", appData
    @app.get @routes.TEMPLATE_PATH, (request, response)->
      view = request.param "view"
      response.render view
    @app.get @routes.DIRECTIVE_PATH, (request, response)->
      template = request.param("template").replace ".html", ""
      response.render "directives/"+template
    @app.use (request, response, next)->
      _self.logger.warning "404 Not Found!: " + request.originalUrl
      response.status(_self.options.status.notFound)
      appData =
        data:
          isDev : _self.isDev
          request: request
      response.render "404", appData

    @server = @app.listen @options.port<commit_msg>added the socket path as static path<commit_after>express = require "express"
jade = require "jade"
fs = require "fs"

class Bootstrap
  _self = undefined
  routes:
    DEFAULT_PATH: "/"
    TEMPLATE_PATH: "/load/:view"
    DIRECTIVE_PATH: "/directive/:template"
    SOCKET_PATH: "/socket.io/"
  options:
    templatePath: "#{__dirname}/../src/templates"
    isDev: "#{__dirname}/../dev"
    contentPath: "#{__dirname}/../frontend"
    libraryPath: "#{__dirname}/../bower_components"
    port: 8080
    status:
      notFound: 404
  isDev: undefined

  constructor: ->
    _self = @
    @isDev = fs.existsSync @options.isDev
    @app = express()

    @app.use "/frontend", express.static(@options.contentPath)
    @app.use "/bower_components", express.static(@options.libraryPath)
    @app.use @routes.SOCKET_PATH, express.static(@routes.SOCKET_PATH)
    @app.set "views", @options.templatePath
    @app.set "view engine", "jade"
    @app.engine "jade", jade.__express

    @app.get @routes.DEFAULT_PATH, (request, response)->
      appData =
        data:
          isDev: _self.isDev
      response.render "index", appData
    @app.get @routes.TEMPLATE_PATH, (request, response)->
      view = request.param "view"
      response.render view
    @app.get @routes.DIRECTIVE_PATH, (request, response)->
      template = request.param("template").replace ".html", ""
      response.render "directives/"+template
    @app.use (request, response, next)->
      _self.logger.warning "404 Not Found!: " + request.originalUrl
      response.status(_self.options.status.notFound)
      appData =
        data:
          isDev : _self.isDev
          request: request
      response.render "404", appData

    @server = @app.listen @options.port
{'fraction_non_alphanumeric': 0.14208955223880598, 'fraction_numerical': 0.007761194029850746, 'mean_word_length': 2.9469964664310955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1165255', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1057, 'n_words': 228}