Skip to content

Commit b9d0516

Browse files
authored
docs: update to express 5 (#1937)
1 parent 512a598 commit b9d0516

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

guide/ssr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (import.meta.env.SSR) {
6363
6464
## 開発サーバーのセットアップ {#setting-up-the-dev-server}
6565
66-
SSR をビルドする際、メインサーバーを完全に制御し、Vite を本番環境から切り離したいと思うでしょう。したがってミドルウェアモードで Vite を使用することをお勧めします。これは [express](https://expressjs.com/)(v4)での例です:
66+
SSR をビルドする際、メインサーバーを完全に制御し、Vite を本番環境から切り離したいと思うでしょう。したがってミドルウェアモードで Vite を使用することをお勧めします。これは [express](https://expressjs.com/) での例です:
6767
6868
```js{15-18} twoslash [server.js]
6969
import fs from 'node:fs'
@@ -93,7 +93,7 @@ async function createServer() {
9393
// 次のコードは再起動後でも有効です。
9494
app.use(vite.middlewares)
9595

96-
app.use('*', async (req, res) => {
96+
app.use('*all', async (req, res) => {
9797
// index.html を提供します - 次にこれに取り組みます。
9898
})
9999

@@ -119,7 +119,7 @@ var app
119119
var vite
120120

121121
// ---cut---
122-
app.use('*', async (req, res, next) => {
122+
app.use('*all', async (req, res, next) => {
123123
const url = req.originalUrl
124124

125125
try {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {
1212
"@shikijs/vitepress-twoslash": "^2.5.0",
1313
"@type-challenges/utils": "^0.1.1",
14-
"@types/express": "^4.17.21",
14+
"@types/express": "^5.0.1",
1515
"@types/node": "^22.13.4",
1616
"feed": "^4.2.2",
1717
"gsap": "^3.12.7",

pnpm-lock.yaml

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)