Skip to content

Commit 37946f6

Browse files
committed
test runtime config ver
1 parent 177ffde commit 37946f6

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default defineNuxtConfig({
6969
runtimeConfig: {
7070
public: {
7171
AMP: process.env.AMP,
72+
version: "1.16.0",
7273
},
7374
},
7475

server/api/version.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { readFileSync } from "fs"
2-
import { join } from "path"
3-
41
export default defineEventHandler(() => {
5-
const { version } = JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8"))
2+
const config = useRuntimeConfig()
63
return {
7-
version,
4+
version: config.public.version,
85
}
96
})

0 commit comments

Comments
 (0)