Skip to content

Commit 6d2f06b

Browse files
docs: update README with contributors and usage examples
Add contributors section and examples for synchronous and asynchronous application usage. Co-authored-by: Junie <junie@jetbrains.com>
1 parent 23770d5 commit 6d2f06b

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export class SheetController {
6565
Bootstrap your application by creating an `App` instance and delegating the standard Apps Script entry points (`doGet`,
6666
`doPost`) to it.
6767

68+
#### Synchronous Application
69+
70+
Use `App` for synchronous execution:
71+
6872
```TypeScript
6973
import {App} from "bootgs";
7074
import {SheetController} from "./SheetController";
@@ -90,6 +94,35 @@ export function doPost(event: GoogleAppsScript.Events.DoPost) {
9094
}
9195
```
9296

97+
#### Asynchronous Application
98+
99+
Use `AsyncApp` when you need to handle asynchronous operations (e.g., `UrlFetchApp` promises or other async tasks) in your controllers:
100+
101+
```TypeScript
102+
import {AsyncApp} from "bootgs";
103+
import {SheetController} from "./SheetController";
104+
105+
/**
106+
* Global entry point for GET requests.
107+
*/
108+
export async function doGet(event: GoogleAppsScript.Events.DoGet) {
109+
const app = AsyncApp.create({
110+
controllers: [SheetController]
111+
});
112+
return await app.doGet(event);
113+
}
114+
115+
/**
116+
* Global entry point for POST requests.
117+
*/
118+
export async function doPost(event: GoogleAppsScript.Events.DoPost) {
119+
const app = AsyncApp.create({
120+
controllers: [SheetController]
121+
});
122+
return await app.doPost(event);
123+
}
124+
```
125+
93126
## Features
94127

95128
- **Decorator-based Routing**: Intuitive mapping of HTTP and Apps Script events (GET, POST, etc.).
@@ -571,6 +604,15 @@ export class GlobalExceptionHandler {
571604
}
572605
```
573606

607+
## Contributors
608+
609+
<a href="https://github.com/felipepmdias">
610+
<img src="https://github.com/felipepmdias.png" width="50" height="50" style="border-radius: 50%" alt="felipepmdias" />
611+
</a>
612+
<a href="https://github.com/kosmo-ds">
613+
<img src="https://github.com/kosmo-ds.png" width="50" height="50" style="border-radius: 50%" alt="kosmo-ds" />
614+
</a>
615+
574616
## Contributing
575617

576618
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on our code of conduct,

0 commit comments

Comments
 (0)