-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastien Ringrose
committed
Jul 18, 2024
1 parent
732f782
commit 12a1d5b
Showing
15 changed files
with
853 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"name": "@sejori/peko", | ||
"description": "Featherweight apps on the edge, built with Web Standards 🐣⚡", | ||
"version": "2.2.0", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"htm": "^3.1.1", | ||
"preact": "^10.19.6", | ||
"preact-render-to-string": "^6.4.0" | ||
"esbuild": "https://deno.land/x/[email protected]/mod.js", | ||
"htm": "https://ga.jspm.io/npm:[email protected]/dist/htm.mjs", | ||
"preact": "https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-render-to-string" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { html } from "htm/preact"; | ||
import { html } from "preact"; | ||
|
||
import Layout from "../components/Layout.ts"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import router from "../../example/preactSSR/router.ts"; | ||
|
||
router.middleware.unshift((ctx) => { | ||
ctx.state.env = process.env | ||
}); | ||
|
||
Bun.serve({ | ||
port: 8080, | ||
fetch(req) { | ||
return router.use((ctx) => ctx.state.env = process.env).handle(req); | ||
return router.handle(req); | ||
}); | ||
|
||
console.log("Bun server running with Peko router <3"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import router from "../../example/preactSSR/router.ts"; | ||
|
||
router.middleware.unshift((ctx) => { | ||
console.log("heelo"); | ||
ctx.state.env = Deno.env.toObject(); | ||
}); | ||
|
||
// Start Deno server with Peko router :^) | ||
Deno.serve( | ||
{ | ||
port: 7777, | ||
}, | ||
(req) => | ||
router.use((ctx) => (ctx.state.env = Deno.env.toObject())).handle(req) | ||
(req) => router.handle(req) | ||
); | ||
|
||
console.log("Deno server running with Peko router <3"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters