Esempio n. 1
0
        /// <summary>
        /// Gets javascript proxy for all services.
        /// </summary>
        public HttpResponseMessage GetAll()
        {
            var script   = _scriptProxyManager.GetAllScript(ProxyScriptType.JQuery);
            var response = Request.CreateResponse(System.Net.HttpStatusCode.OK, script, new PlainTextFormatter());

            response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-javascript");
            return(response);
        }
        /// <summary>
        /// Gets JavaScript proxy for all services.
        /// </summary>
        /// <param name="type">Script type</param>
        /// <param name="minify"></param>
        public HttpResponseMessage GetAll(ProxyScriptType type = ProxyScriptType.JQuery, bool minify = false)
        {
            var script   = _scriptProxyManager.GetAllScript(type);
            var response = Request.CreateResponse(System.Net.HttpStatusCode.OK,
                                                  minify ? _javaScriptMinifier.Minify(script) : script, new PlainTextFormatter());

            response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-javascript");
            return(response);
        }