 KoaRouter           = require 'koa-router'
 bodyParser          = require 'koa-bodyparser'
 request             = require 'request-promise'
+url                 = require 'url'
 
 # Base Nodeswork class.
 #


  request: (opts) ->
    @requestClient _.extend {}, opts, {
      url: "#{@opts.server}#{opts.url}"
    }

  requestDefaults: (opts) ->

  startTime    = Date.now()

  try
    unless (appletId = nw.config 'appletId')?
      throw new Error "Applet id is missing in configuration."

    ctx.userId                 = ctx.request.body.userId
    {user, userApplet, applet} = await nw.request {
