Skip to content

Commit

Permalink
fix http_counter example
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Oct 2, 2023
1 parent 54caaf8 commit 1926b14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
23 changes: 3 additions & 20 deletions examples/motoko_examples/http_counter/src/index.did
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
type rec_0 = record {url:text; method:text; body:vec nat8; headers:vec record {text; text}};
type rec_6 = record {arbitrary_data:text};
type rec_5 = record {arbitrary_data:text};
type rec_4 = record {token:opt rec_5; body:vec nat8};
type rec_3 = record {token:rec_6; callback:func (text) -> (rec_4) query};
type rec_2 = variant {Callback:rec_3};
type rec_1 = record {body:vec nat8; headers:vec record {text; text}; upgrade:opt bool; streaming_strategy:opt rec_2; status_code:nat16};
type rec_7 = record {url:text; method:text; body:vec nat8; headers:vec record {text; text}};
type rec_13 = record {arbitrary_data:text};
type rec_12 = record {arbitrary_data:text};
type rec_11 = record {token:opt rec_12; body:vec nat8};
type rec_10 = record {token:rec_13; callback:func (text) -> (rec_11) query};
type rec_9 = variant {Callback:rec_10};
type rec_8 = record {body:vec nat8; headers:vec record {text; text}; upgrade:opt bool; streaming_strategy:opt rec_9; status_code:nat16};
type rec_14 = record {arbitrary_data:text};
type rec_16 = record {arbitrary_data:text};
type rec_15 = record {token:opt rec_16; body:vec nat8};
service: () -> {
http_request: (rec_0) -> (rec_1) query;
http_request_update: (rec_7) -> (rec_8);
http_streaming: (rec_14) -> (rec_15) query;
http_request: (record {url:text; method:text; body:vec nat8; headers:vec record {text; text}; certificate_version:opt nat16}) -> (record {body:vec nat8; headers:vec record {text; text}; upgrade:opt bool; streaming_strategy:opt variant {Callback:record {token:record {arbitrary_data:text}; callback:func (text) -> (record {token:opt record {arbitrary_data:text}; body:vec nat8}) query}}; status_code:nat16}) query;
http_request_update: (record {url:text; method:text; body:vec nat8; headers:vec record {text; text}; certificate_version:opt nat16}) -> (record {body:vec nat8; headers:vec record {text; text}; upgrade:opt bool; streaming_strategy:opt variant {Callback:record {token:record {arbitrary_data:text}; callback:func (text) -> (record {token:opt record {arbitrary_data:text}; body:vec nat8}) query}}; status_code:nat16});
http_streaming: (record {arbitrary_data:text}) -> (record {token:opt record {arbitrary_data:text}; body:vec nat8}) query;
}
3 changes: 2 additions & 1 deletion examples/motoko_examples/http_counter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const HttpRequest = Record({
method: text,
url: text,
headers: Vec(HeaderField),
body: blob
body: blob,
certificate_version: Opt(nat16)
});

let stableStorage = StableBTreeMap(text, nat, 0);
Expand Down

0 comments on commit 1926b14

Please sign in to comment.