-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add client side svelte example
- Loading branch information
1 parent
0c5cca9
commit 8643a1f
Showing
11 changed files
with
77 additions
and
28 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,6 +1,2 @@ | ||
/// <reference types="svelte" /> | ||
/// <reference types="vite/client" /> | ||
/// <reference types="stack54/client" /> | ||
|
||
/// <reference path="../.stack54/env.d.ts" /> | ||
/// <reference path="../.stack54/views.d.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @ts-check | ||
|
||
import express, {static as static_} from "express"; | ||
import router from "../dist/server/index.js"; | ||
|
||
const app = express(); | ||
|
||
const serve_build_assets = static_("./dist", { | ||
immutable: true, | ||
maxAge: "1y", | ||
}); | ||
|
||
// http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header | ||
app.disable("x-powered-by"); | ||
|
||
app.use(serve_build_assets); | ||
|
||
app.use(static_("static", { maxAge: "1h" })); | ||
|
||
app.use(router); | ||
|
||
const port = process.env.PORT || 3000; | ||
|
||
app.listen(port, () => { | ||
console.log(`✅ app ready: http://localhost:${port}`); | ||
}); |
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,12 +1,12 @@ | ||
import { Hono } from "hono"; | ||
import { view } from "stack54/view"; | ||
import express from "express"; | ||
import { register } from "@stack54/express/render"; | ||
|
||
import { render } from "./utils/view"; | ||
|
||
const app = new Hono(); | ||
const app = express(); | ||
|
||
app.use(view(render)); | ||
register(app, render); | ||
|
||
app.get("/", (ctx) => ctx.render("welcome", {})); | ||
app.get("/", (_, res) => res.render("welcome", {})); | ||
|
||
export default app; |
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,6 +1,2 @@ | ||
/// <reference types="svelte" /> | ||
/// <reference types="vite/client" /> | ||
/// <reference types="stack54/client" /> | ||
|
||
/// <reference path="../.stack54/env.d.ts" /> | ||
/// <reference path="../.stack54/views.d.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineConfig } from "stack54/config"; | ||
import express from "@stack54/express/plugin"; | ||
|
||
export default defineConfig({ | ||
integrations: [express()], | ||
}); |
File renamed without changes
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 @@ | ||
{ | ||
"extends": "stack54/tsconfigs/base", | ||
"include": ["src", "vite.config.ts"] | ||
"include": ["src"] | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.