aboutsummaryrefslogtreecommitdiff
path: root/docs/ecosystem/stric.md
blob: 5f2787d75daf3611889fc31ee4a7b68625dde5f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[Stric](https://github.com/bunsvr) is a minimalist, fast web framework for Bun.

```ts#index.ts
import { Router } from '@stricjs/router';

// Export the fetch handler and serve with Bun
export default new Router()
  // Return 'Hi' on every request
  .get('/', () => new Response('Hi'));
```

Stric provides support for [ArrowJS](https://www.arrow-js.com), a library for building reactive interfaces. 

{% codetabs %}

```ts#src/App.ts
import { html } from '@stricjs/arrow/utils';

// Code inside this function can use web APIs
export function render() {
  // Render a <p> element with text 'Hi'
  html`<p>Hi</p>`;
};

// Set the path to handle
export const path = '/';
```
```ts#index.ts
import { PageRouter } from '@stricjs/arrow';

// Create a page router, build and serve directly
new PageRouter().serve();
```

{% /codetabs %}

For more info, see Stric's [documentation](https://stricjs.gitbook.io/docs).