Skip to content

Commit

Permalink
changed BulletTrain client SDK version
Browse files Browse the repository at this point in the history
  • Loading branch information
sevikarakose committed May 28, 2020
1 parent 6c3765f commit c34eb51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 2 additions & 8 deletions Controllers/GlossaryController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BulletTrain;
using Microsoft.AspNetCore.Mvc;


Expand All @@ -14,13 +13,8 @@ public class GlossaryController : ControllerBase
[HttpGet]
public async Task<ActionResult<string>> Get()
{
BulletTrainConfiguration configuration = new BulletTrainConfiguration()
{
ApiUrl = "http://localhost:8000/api/v1/",
EnvironmentKey = "my-local-env-key"
};

BulletTrainClient bulletClient = new BulletTrainClient(configuration);
var bulletClient = BulletTrain.BulletTrainClient.instance;

bool featureEnabled = await bulletClient.HasFeatureFlag("show_feature");
if (featureEnabled)
{
Expand Down
4 changes: 2 additions & 2 deletions Glossary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<ItemGroup>
</ItemGroup>

<ItemGroup>
<PackageReference Include="BulletTrain" Version="2.0.0" />
<ItemGroup>
<PackageReference Include="BulletTrain" Version="2.0.1" />
</ItemGroup>


Expand Down
8 changes: 8 additions & 0 deletions Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using BulletTrain;



namespace Glossary
{
Expand All @@ -26,6 +29,11 @@ public Startup(IConfiguration configuration)
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSingleton(typeof(BulletTrainClient),new BulletTrainClient(new BulletTrainConfiguration()
{
ApiUrl = "http://localhost:8000/api/v1/",
EnvironmentKey = "nx8GEprrr6gL5t3ckRUCfy"
}));
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down

0 comments on commit c34eb51

Please sign in to comment.