Get Started
Installation
Install the ovr
package from npm using your preferred package manager.
npm i ovr
Alternatively, you can setup ovr with a pre-configured template using Vite with domco. This includes live reload and options for Tailwind, deployment adapters, and more. domco will create a server entry point in src/server/+app.tsx
with ovr pre-configured.
npx create-domco@latest --framework=ovr
JSX
To utilize JSX, add the following options to your tsconfig.json
to enable the JSX transform. TypeScript, Vite, or esbuild will pickup the option from this file.
{ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "ovr" } }
Or you can use a comment if you are using ovr in conjunction with another framework to specify the import source for a specific module where you are using ovr.
/** @jsx jsx */
/** @jsxImportSource ovr */
Compatibility
ovr can be used in any Fetch API compatible runtime via app.fetch
. Here are a few ways to create a Fetch based HTTP server in various JavaScript runtimes.
- domco - run
npm create domco
and selectovr
framework - Cloudflare Vite Plugin + vite-ssr-components
- Node + srvx
- Bun HTTP server
- Deno HTTP server
For example, using srvx
you can plug app.fetch
into the serve
options.
// src/index.tsx
import { App } from "ovr";
import { serve } from "srvx";
const app = new App();
app.get("/", () => <h1>Hello World</h1>);
serve({ fetch: app.fetch });
Then can compile tsx
into js
with TypeScript, and run the server with Node.
tsc && node dist/index.js