Skip to content

Commit

Permalink
docs: OfflineMode for .Net and NodeJS (#3697)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Rometsch <[email protected]>
  • Loading branch information
novakzaballa and dabeeeenster authored Mar 28, 2024
1 parent ee1c396 commit 87a6901
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/docs/clients/server-side.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,44 @@ public class MyCustomOfflineHandler implements IOfflineHandler:
}
```

</TabItem>
<TabItem value="dotnet" label=".NET">

```csharp
// Using the built-in local file handler
var localFileHandler = new LocalFileHandler("path_to_environment_file/environment_file.json");

var flagsmithClient = new FlagsmithClient(
offlineMode: true,
offlineHandler: localFileHandler
);

// Defining a custom offline handler
public class MyCustomOfflineHandler: BaseOfflineHandler
{
public override EnvironmentModel GetEnvironment()
{
return someMethodToGetTheEnvironment();
}
}
```

</TabItem>
<TabItem value="nodejs" label="NodeJS">

```javascript
// Using the built-in local file handler
const localFileHandler = new LocalFileHandler("path_to_environment_file/environment_file.json");
const flagsmith = new Flagsmith({ offlineMode: true, offlineHandler: localFileHandler });

// Defining a custom offline handler
class CustomOfflineHandler extends BaseOfflineHandler {
getEnvironment(): EnvironmentModel {
return someMethodToGetTheEnvironment();
}
}
```

</TabItem>
<TabItem value="ruby" label="Ruby">

Expand Down

0 comments on commit 87a6901

Please sign in to comment.