R
Reface
Documentation

Getting Started

Quick Setup

  1. Create a new project:

example.bashbash
1# Using Deno
2mkdir my-reface-app
3cd my-reface-app
4touch main.ts
  1. Add dependencies:

example.typescripttypescript
1import { Reface } from "jsr:@vseplet/reface";
  1. Create your first page:

example.typescripttypescript
1// main.ts
2import { Reface } from "@reface";
3import { Hono } from "@hono/hono";
4
5const app = new Hono();
6
7// Create layout
8const Layout = component((_, children) => (
9 ​<html>
10 ​<head>
11 ​<title>My First Reface Apptitle>
12 head>
13 ​<body>{children}body>
14 html>
15));
16
17// Create page
18function HomePage() {
19 return (
20 ​<div class="container">
21 ​<h1>Welcome to Reface!h1>
22 ​<p>This is your first pagep>
23 div>
24 );
25}
26
27// Initialize Reface
28const reface = new Reface({
29 layout: Layout,
30});
31
32// Setup routes
33app.route("/", reface.page("/", HomePage).hono());
34
35// Start server
36Deno.serve(app.fetch);
  1. Run the app:

example.bashbash
1deno run -A main.ts

Next Steps