- A deck is represented as a json list of Card objects.
- Your application should accept an URL on the command line. You should do a GET against this URL. This will give you the deck we expect you to play the game with
- The response will contain a json list of Card objects:
{"suit":"HEARTS","value":"5"}
, where suit is one ofHEARTS | CLUBS | SPADES | DIAMONDS
and value is one of the set2,3,4,5,6,7,8,9,10,J,Q,K,A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const tokenMiddleware = (tokenValidator: TokenValidator) => { | |
return async (req: Request, res: Response, next: NextFunction) => { | |
const apiToken = req.header('authorization'); | |
if (!apiToken) { | |
return res | |
.status(401) | |
.send({ message: 'You must authenticate to use Unleash on the Edge' }); | |
} | |
await tokenValidator.registerToken(apiToken); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
FEATURE_CREATED, | |
FEATURE_UPDATED, | |
FEATURE_ARCHIVED, | |
FEATURE_REVIVED, | |
FEATURE_STALE_ON, | |
FEATURE_STALE_OFF, | |
FEATURE_ENVIRONMENT_ENABLED, | |
FEATURE_ENVIRONMENT_DISABLED, | |
FEATURE_STRATEGY_REMOVE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomVersionRangeStrategy implements Strategy { | |
@Override | |
public String getName() { | |
return "CustomVersionStrategy"; | |
} | |
@Override | |
public boolean isEnabled(Map<String, String> parameters) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://json-schema.org/draft/2020-12/schema", | |
"$id": "https://docs.getunleash.io/schema/event.schema.json", | |
"title": "Unleash Event", | |
"description": "...", | |
"type": "object", | |
"required": ["eventId", "eventType", "featureName", "context"], | |
"properties": { | |
"eventId": { | |
"type": "string", |
id | project | environment | strategy_name | parameters | constraints | feature_name | stale | feature_type | variants |
---|---|---|---|---|---|---|---|---|---|
70e1a60c-d891-49c3-8042-b88da112b14f | default | :global: | 4days | {"b2b": "true", "currentSubsription": "true"} | [] | 4dayscancel | false | operational | [] |
2d42e3f1-2430-473f-aa74-4c39404c793b | default | :global: | {"email": "test@test.co.za"} | [] | 4dayscancel | false | operational | [] | |
2e54152e-c43e-4a46-9430-397f8fc7bae0 | default | :global: | flexibleRollout | {"groupId": "asadsad", "rollout": 72, "stickiness": "userId"} | [{"values": ["asia"], "operator": "IN", "contextName": "region"}] | asadsad | false | release | [] |
9256d882-3147-414a-98f9-b01943422cfb | default | :global: | default | {} | [] | asdas | false | kill-switch | [] |
9f804c9c-01b0-423e-93b6-a325628560be | default | :global: | default | {} | NULL | asdasd | false | operational | [{"name":"123","wei |
We just released unleash-client-java 4.2.1. This version includes a new way to bootstrap Unleash using a JSON string matching the /api/client/features
format.
First; update your Unleash dependency to 4.2.1
- Maven
<dependency> <groupId>no.finn.unleash</groupId> <artifactId>unleash-client-java</artifactId>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Topbar exposing (..) | |
import Http | |
import Task exposing (..) | |
type Msg = | |
NoOp | |
| Error Http.Error | |
| Success String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main (..) where | |
import Signal exposing (Signal, map) | |
import Random exposing (Seed) | |
import Html exposing (..) | |
import Effects exposing (Effects, Never) | |
import Task | |
import Components.Zombie exposing (..) | |
import StartApp | |
import Random exposing (initialSeed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publish { | |
dependsOn assemble | |
} | |
dependencyManagement { | |
imports { | |
mavenBom 'org.springframework:spring-framework-bom:4.2.4.RELEASE' | |
} | |
} |
NewerOlder