This file contains hidden or 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
| server { | |
| listen 3000; | |
| proxy_cache my_cache; | |
| location / { | |
| proxy_set_header Host $host; | |
| proxy_pass http://my-backend-service/; | |
| proxy_cache_key $scheme://$host$uri$is_args$query_string; | |
| proxy_cache_valid 200 10m; | |
| } |
This file contains hidden or 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
| HTTP/1.1 200 OK | |
| <html> | |
| <body> | |
| <div>Account number: 12345</div> | |
| <div>Balance: $100.00 USD</div> | |
| <div>Links: | |
| <a href="/accounts/12345/deposits">deposits</a> | |
| <a href="/accounts/12345/withdrawals">withdrawals</a> | |
| <a href="/accounts/12345/transfers">transfers</a> | |
| </div> |
This file contains hidden or 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
| HTTP/1.1 200 OK | |
| <html> | |
| <body> | |
| <div>Account number: 12345</div> | |
| <div>Balance: -$50.00 USD</div> | |
| <div>Links: | |
| <a href="/accounts/12345/deposits">deposits</a> | |
| </div> | |
| <body> |
This file contains hidden or 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
| { | |
| "account": { | |
| "account_number": 12345, | |
| "balance": { | |
| "currency": "usd", | |
| "value": -50.00 | |
| }, | |
| "status": "overdrawn" | |
| } | |
| } |
This file contains hidden or 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
| { | |
| employee(id: 1234567) { | |
| id, | |
| name | |
| } | |
| } |
This file contains hidden or 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
| { | |
| employee(id: 3500401) { | |
| id, | |
| name, | |
| salary | |
| } | |
| } |
This file contains hidden or 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
| GET /accounts/12345 HTTP/1.1 | |
| Host: bank.example.com |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "ES5", | |
| "experimentalDecorators": true | |
| } | |
| } |
This file contains hidden or 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
| class Monster { | |
| health: number; | |
| constructor(health: number) { | |
| this.health = health; | |
| } | |
| takeDamage(damage: number): number { | |
| console.log(`Monster health: ${this.health} and damage: ${damage}`); | |
| this.health -= damage; |
This file contains hidden or 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
| function log(target: any, methodName: string, descriptor: PropertyDescriptor) { | |
| const originalMethod = descriptor.value; | |
| descriptor.value = function (...args: any[]) { | |
| console.log(Method ${methodName} called with arguments: ${JSON.stringify(args)}); | |
| console.log(`State before method ${methodName}: ${JSON.stringify(this)}`); | |
| const result = originalMethod.apply(this, args); | |
| console.log(Method ${methodName} returned: ${JSON.stringify(result)}); | |
| return result; |
OlderNewer