<commit_before>define ->
  rpc = null

  catchAll = (res)->
    console.warn("CatchAll Handler: ", res)
    res

  (env)->
    config:
      require:
        paths:
          'easyXDM':            'easyXDM/easyXDM'
          'route-recognizer' :  'route-recognizer/dist/route-recognizer.amd'
        shim:
          easyXDM: { exports: 'easyXDM' }


    init: (env)->
      core = env.core
      Router = require('route-recognizer')
      core.services = new Router

      onRemoteMessage = (req, callback, errback)->
        throw new Error("Path not recognized #{JSON.stringify(req)}") unless req.path

        routes  = core.services.recognize(req.path)

        if routes && route = routes[0]
          route.handler(req, route, callback, errback)
        else
          errback(catchAll(req))

      rpc = new easyXDM.Rpc({}, {
        remote: { message: {}, ready: {} }
        local:  { message: onRemoteMessage }<commit_msg>Adding easyXDM acl config to remote/services<commit_after>define ->
  rpc = null

  catchAll = (res)->
    console.warn("CatchAll Handler: ", res)
    res

  (env)->
    config:
      require:
        paths:
          'easyXDM':            'easyXDM/easyXDM'
          'route-recognizer' :  'route-recognizer/dist/route-recognizer.amd'
        shim:
          easyXDM: { exports: 'easyXDM' }


    init: (env)->
      core = env.core
      Router = require('route-recognizer')
      core.services = new Router

      onRemoteMessage = (req, callback, errback)->
        throw new Error("Path not recognized #{JSON.stringify(req)}") unless req.path

        routes  = core.services.recognize(req.path)

        if routes && route = routes[0]
          route.handler(req, route, callback, errback)
        else
          errback(catchAll(req))

      rpc = new easyXDM.Rpc({
        acl: env.config.appDomains
      }, {
        remote: { message: {}, ready: {} }
        local:  { message: onRemoteMessage }
{'fraction_non_alphanumeric': 0.13009808982963345, 'fraction_numerical': 0.0010325245224574084, 'mean_word_length': 2.0859872611464967, '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': '3714005', 'n_tokens_mistral': 620, 'n_tokens_neox': 587, 'n_words': 133}