 
       for url, action of actions
         do (url, action) ->
-          app.post "#{prefix}/#{resource}/:id#{url}", (req, res, next) ->
+          app.post "#{resource}/:id#{url}", (req, res, next) ->
             if checkAuth(action.auth)
               action(req, res, next)
 

      prefix = config.get('prefix')
      globalQueryLimit = config.get('queryLimit')

      resource = params.url
      resource = params.url[1..]  if params.url.indexOf('/') is 0
      if resource.indexOf('/') >= 0
        throw new Error("Resource of url can't contain '/', it can only be allowed to exist in the beginning.")
      model = params.model

      metadata.add(resource, model)

      rest = params.rest || {}
      actions = params.actions || []

      resource = "#{prefix}/#{resource}"
      routes =
        'create':
          method: 'post'
          url: "#{resource}"
          controller: require './request/handle/post'
          config: rest.post || rest.create || {}
        'update':
          method: 'put'
          url: "#{resource}/:id"
          controller: require './request/handle/put'
          config: rest.put || rest.update || {}
        'del':
          method: 'del'
          url: "#{resource}/:id"
          controller: require './request/handle/delete'
          config: rest.delete || rest.del || {}
        'read':
          method: 'get'
          url: "#{resource}/:id"
          controller: require('./request/handle/get').get
          config: rest.get || rest.read || {}
        'readAll':
          method: 'get'
          url: "#{resource}"
          controller: require('./request/handle/get').getAll
          config: rest.getAll || rest.readAll || {}

