using System.Collections.Generic;
using System.Linq;
using Glimpse.Core2.Extensibility;
using Glimpse.Core2.Framework;
using Glimpse.Core2.ResourceResult;

namespace Glimpse.Core2.Resource
{
    public class Metadata : IResource
    {
        internal const string InternalName = "metadata.js";
        private const int CacheDuration = 12960000; //150 days

        public string Name
        {
            get { return InternalName; }
        }

        public IEnumerable<string> ParameterKeys
        {
            get { return new[] { ResourceParameterKey.VersionNumber }; }
        }

        public IResourceResult Execute(IResourceContext context)
        {
            var metadata = context.PersistanceStore.GetMetadata();

            if (metadata == null)
                return new StatusCodeResourceResult(404);

            return new JsonResourceResult(metadata, "console.log", CacheDuration, CacheSetting.Public);
        }
    }
}
using System.Collections.Generic;
using System.Linq;
using Glimpse.Core2.Extensibility;
using Glimpse.Core2.Framework;
using Glimpse.Core2.ResourceResult;

namespace Glimpse.Core2.Resource
{
    public class Metadata : IResource
    {
        internal const string InternalName = "metadata.js";
        private const int CacheDuration = 12960000; //150 days

        public string Name
        {
            get { return InternalName; }
        }

        public IEnumerable<string> ParameterKeys
        {
            get { return new[] { ResourceParameterKey.VersionNumber, ResourceParameterKey.Callback }; }
        }

        public IResourceResult Execute(IResourceContext context)
        {
            var metadata = context.PersistanceStore.GetMetadata();

            if (metadata == null)
                return new StatusCodeResourceResult(404);

            return new JsonResourceResult(metadata, context.Parameters[ResourceParameterKey.Callback], CacheDuration, CacheSetting.Public);
        }
    }
}
Update metadata resource to use callback instead of console.log
Update metadata resource to use callback instead of console.log
