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:
npx create-domco@latest --framework=ovr
JSX configuration
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 */
While the ovr package does not depend on React, it uses the same JSX transform as React. This transform is built into
tscand other build tools.
Compatibility
ovr uses entirely standard JavaScript APIs, so it can run anywhere.
The ovr App server 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 domcoand selectovrframework - Nitro - example repo
- 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.use(() => <h1>Hello World</h1>);
serve({ fetch: (req) => app.fetch(req) });
Then can compile tsx into js with TypeScript, and run the server with Node.
tsc && node dist/index.js