Skip to content

Instantly share code, notes, and snippets.

View mts88's full-sized avatar

Francesca Motisi mts88

View GitHub Profile
@mts88
mts88 / image.component.ts
Created November 11, 2021 20:23
Feature Flag Usage
import { Component, OnInit } from '@angular/core';
import { FeatureFlagService } from 'src/app/shared/services/feature-flag.service';
@Component({
selector: 'app-image',
templateUrl: 'image.component.html',
styles: [],
})
export class ImageComponent implements OnInit {
constructor(private readonly featureFlagService: FeatureFlagService) {}
@mts88
mts88 / app.component.ts
Created November 11, 2021 19:55
Feature Flag App Component
import { Component, OnInit } from '@angular/core';
import { FeatureFlagService } from 'src/app/shared/services/feature-flag.service';
@Component({
selector: 'app-root',
template: `<router-outlet></router-outlet>`,
styles: [],
})
export class AppComponent implements OnInit {
constructor(private readonly featureFlagService: FeatureFlagService) {}
import { Injectable } from '@angular/core';
import { IMutableContext, UnleashClient } from 'unleash-proxy-client';
@Injectable({
providedIn: 'root',
})
export class FeatureFlagService {
unleash = new UnleashClient({
url: `http://localhost:3000/proxy`, // url to Unleash Proxy
@mts88
mts88 / feature-flag.service.ts
Created November 11, 2021 19:51
Feature Flag Service
import { Injectable } from '@angular/core';
import { IMutableContext, UnleashClient } from 'unleash-proxy-client';
@Injectable({
providedIn: 'root',
})
export class FeatureFlagService {
unleash = new UnleashClient({
url: `http://localhost:3000/proxy`, // url to Unleash Proxy
@mts88
mts88 / unleash-docker.sh
Created November 11, 2021 19:28
Unleash Proxy Docker
docker run \
-e UNLEASH_PROXY_SECRETS=my_secret_for_client \
-e UNLEASH_URL=https://gitlab.com/api/v4/feature_flags/unleash/1111111 \
-e UNLEASH_INSTANCE_ID=XXXXXXXX \
-e UNLEASH_API_TOKEN=YYYYYY \
-e UNLEASH_APP_NAME=development \
-p 3000:3000 \
unleashorg/unleash-proxy:0.4.0