AlexCuse / SquishIt.S3

SquishIt integration with Amazon S3
8 stars 2 forks source link

WebActivator #1

Closed AlexCuse closed 12 years ago

AlexCuse commented 12 years ago

Need to implement configuration for default release renderer in squishit core first

Add exception in global.asax to force user to configure creds/bucket name?

AlexCuse commented 12 years ago

configure Global.asax.cs

S3 setup in Application_Start

Dispose S3Renderer in Application_End

AlexCuse commented 12 years ago
    protected void Application_Start()
    {
        var s3client = new AmazonS3Client("access", "secret");
        var renderer = new S3Renderer("bucketname", s3client, HttpContext.Current.Request.PhysicalApplicationPath, HttpContext.Current.Request.ApplicationPath) as IRenderer;
        Configuration.Instance
            .UseReleaseRenderer(renderer)
            .UseOutputBaseHref("http://s3.amazonaws.com/bucketname");

        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
    }