Skip to content

Commit

Permalink
chore: online stackblitz playground (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Jul 18, 2023
1 parent a3192fb commit 125f8c9
Show file tree
Hide file tree
Showing 8 changed files with 679 additions and 454 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

H3 is a minimal h(ttp) framework built for high performance and portability.

👉 [Online Playground](https://stackblitz.com/github/unjs/h3/tree/main/playground?startScript=dev)

## Features

✔️  **Portable:** Works perfectly in Serverless, Workers, and Node.js
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dev": "vitest",
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test playground",
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test playground -w",
"play": "jiti ./playground/index.ts",
"play": "listhen ./playground/app.ts",
"profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./playground/server.cjs",
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
"test": "pnpm lint && vitest run --coverage"
Expand Down Expand Up @@ -52,13 +52,13 @@
"express": "^4.18.2",
"get-port": "^7.0.0",
"jiti": "^1.19.1",
"listhen": "^1.0.4",
"listhen": "^1.1.2",
"node-fetch-native": "^1.2.0",
"prettier": "^2.8.8",
"supertest": "^6.3.3",
"typescript": "^5.1.6",
"unbuild": "^1.2.1",
"vitest": "^0.33.0"
},
"packageManager": "pnpm@8.6.8"
}
"packageManager": "pnpm@8.6.9"
}
12 changes: 12 additions & 0 deletions playground/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createApp, defineEventHandler, toNodeListener } from "h3";

const app = createApp({ debug: true });

app.use(
"/",
defineEventHandler((event) => {
return { path: event.path, message: "Hello World!" };
})
);

export default toNodeListener(app);
47 changes: 0 additions & 47 deletions playground/index.ts

This file was deleted.

12 changes: 12 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "h3-playground",
"private": true,
"scripts": {
"start": "listhen ./app.ts",
"dev": "listhen -w ./app.ts"
},
"dependencies": {
"h3": "^1.7.1",
"listhen": "^1.1.2"
}
}
10 changes: 0 additions & 10 deletions playground/server.cjs

This file was deleted.

Loading

0 comments on commit 125f8c9

Please sign in to comment.