Skip to content

Commit

Permalink
docs(changeset): route rules for dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Dec 3, 2023
1 parent a729253 commit 0f9a5df
Show file tree
Hide file tree
Showing 21 changed files with 159 additions and 935 deletions.
6 changes: 6 additions & 0 deletions .changeset/bright-glasses-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@vinxi/server-functions": patch
"vinxi": patch
---

route rules for dev server
16 changes: 8 additions & 8 deletions docs/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ function wouterFileRouter(config) {

export default createApp({
server: {
// routeRules: {
// "**/*": {
// headers: {
// "Cross-Origin-Embedder-Policy": "require-corp",
// "Cross-Origin-Opener-Policy": "same-origin",
// },
// },
// },
routeRules: {
"/**": {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
},
},
},
},
routers: [
{
Expand Down
22 changes: 17 additions & 5 deletions docs/app/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,26 @@ The surface layer we are intending to tackle:

## Try it out

```bash
<CH.Code>

```bash pnpm
pnpm install vinxi
```

```bash npm
npm install vinxi
```

```bash yarn
yarn add vinxi
```

```bash bun
bun install vinxi
```

</CH.Code>

### React SSR

```ts
Expand All @@ -58,15 +74,13 @@ export default createApp({
name: "client",
mode: "build",
handler: "./app/client.tsx",
target: "browser",
plugins: () => [reactRefresh()],
base: "/_build",
},
{
name: "ssr",
mode: "handler",
handler: "./app/server.tsx",
target: "server",
},
],
});
Expand All @@ -89,15 +103,13 @@ export default createApp({
name: "client",
mode: "build",
handler: "./app/client.tsx",
target: "browser",
plugins: () => [solid({ ssr: true })],
base: "/_build",
},
{
name: "ssr",
mode: "handler",
handler: "./app/server.tsx",
target: "server",
plugins: () => [solid({ ssr: true })],
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export const meta = {
title: "Server Runtime"
}

# Server Runtime

Vinxi takes care of your server runtime needs. It's based on `unjs/h3`. Our philosophy is to abstract over all the different runtimes/platforms. Vinxi provides a set of helpers that covers all the usual use cases of the app to interact with the server platform. Apart from that it exposes the bare platform native objects for you to manipulate as necessary
Expand Down
2 changes: 1 addition & 1 deletion docs/app/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function createRouter() {
route.$component,
import.meta.env.MANIFEST["client"],
),

...(route.$$meta ? { meta: route.$$meta } : {}),
children: route.children?.map(createRoute),
...(route.$$loader
? {
Expand Down
95 changes: 0 additions & 95 deletions docs/content/0.index.md

This file was deleted.

26 changes: 0 additions & 26 deletions docs/content/1.guide/0.index.md

This file was deleted.

Loading

0 comments on commit 0f9a5df

Please sign in to comment.