Files
bun.sh/docs/ecosystem/stric.md
Revenity c2a223802b Add StricJS to ecosystem (#2747)
* Create stric.md

* Update nav.ts

* Update stric.md

Add codetabs for ArrowJS

* Update stric.md

* Update stric.md
2023-05-01 10:37:39 -07:00

923 B

Stric is a minimalist, fast web framework for Bun.

import { App } from "@stricjs/core";

// Export the fetch handler and serve with Bun
export default new App()
  // Return "Hi!" on every request
  .use(() => new Response("Hi!"));

Stric provides support for ArrowJS, a library for building reactive interfaces in native JavaScript.

{% codetabs %}

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 = "/";
import { PageRouter } from "@stricjs/arrow";

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

{% /codetabs %}

For more info, see Stric's documentation.