Skip to content

Commit fd7ecec

Browse files
authored
docs(core): add small usage & getting started example (#3598)
This PR just fills out the `README.md` with minimal usage example, such that they can get a small taste of how the framework can be used. This also helps improve the score in JSR. Part of #3597
1 parent 23734a0 commit fd7ecec

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/fresh/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,27 @@ Standards. It’s designed for building high-quality, performant, and personaliz
55
web applications.
66

77
[Learn more about Fresh](https://fresh.deno.dev/)
8+
9+
## Usage
10+
11+
Generate a new Fresh project with `@fresh/init`:
12+
13+
```sh
14+
deno run -Ar jsr:@fresh/init
15+
```
16+
17+
Add middleware, routes, & endpoints as needed via the `routes/` folder or
18+
directly on the `App` instance.
19+
20+
```tsx
21+
import { App } from "fresh";
22+
23+
const app = new App()
24+
.get("/", () => new Response("hello world"))
25+
.get("/jsx", (ctx) => ctx.render(<h1>render JSX!</h1>));
26+
27+
app.listen();
28+
```
29+
30+
For more information on getting started with Fresh, head on over to the
31+
[documentation](https://fresh.deno.dev/docs/introduction).

0 commit comments

Comments
 (0)