Skip to content

Commit

Permalink
feat: 尝试迁移到 serverless ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
Otto-J committed Oct 30, 2023
1 parent a7c834a commit 2da9594
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 460 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# 使用 node v18 启用 corepack pnpm,pnpm run build
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# 手动触发
workflow_dispatch:

# push:
# branches: [main]
# pull_request:
# branches: [main]

jobs:
build:
Expand Down
7 changes: 7 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default defineNuxtConfig({
"node_modules/unstorage-xlog-driver/dist/index.mjs",
),
characterId: 53709,
ttl: 60 * 2,
prefix: "/blogs",
},
},
Expand Down Expand Up @@ -175,6 +176,12 @@ export default defineNuxtConfig({
// "/podcasts?page=3",
],
},
preset: "node-server",
output: {
dir: "dist",
// serverDir: "dist/server",
// publicDir: "dist/server",
},
},
runtimeConfig: {
// only ssr
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"build": "nuxt build && cp scf_bootstrap dist/scf_bootstrap",
"dev": "nuxt dev",
"generate": "nuxt generate",
"g": "nuxt generate",
"preview": "nuxt preview",
"start": "PORT=9000 node ./.output/server/index.mjs",
"format": "prettier --write ."
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 2da9594

Please sign in to comment.