From 57be142e53ab1cce935227b2ed22d96068fdb51c Mon Sep 17 00:00:00 2001 From: keymasroy Date: Tue, 14 Sep 2021 14:05:08 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=90=EC=9C=A1=EC=9A=A9=20=EC=83=98?= =?UTF-8?q?=ED=94=8C=20=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sample/sub-component.vue | 40 +++++++ front/fo/client/middleware/custom.ts | 5 + front/fo/client/pages/sample2/index.vue | 100 ++++++++++++++++++ front/fo/nuxt.config.ts | 5 +- front/fo/package.json | 6 +- 5 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 front/fo/client/components/sample/sub-component.vue create mode 100644 front/fo/client/middleware/custom.ts create mode 100644 front/fo/client/pages/sample2/index.vue diff --git a/front/fo/client/components/sample/sub-component.vue b/front/fo/client/components/sample/sub-component.vue new file mode 100644 index 0000000..cc1f17f --- /dev/null +++ b/front/fo/client/components/sample/sub-component.vue @@ -0,0 +1,40 @@ + + + diff --git a/front/fo/client/middleware/custom.ts b/front/fo/client/middleware/custom.ts new file mode 100644 index 0000000..a55cadf --- /dev/null +++ b/front/fo/client/middleware/custom.ts @@ -0,0 +1,5 @@ +import { Context } from '@nuxt/types' + +export default async (context: Context) => { + console.log('executed') +} diff --git a/front/fo/client/pages/sample2/index.vue b/front/fo/client/pages/sample2/index.vue new file mode 100644 index 0000000..1606da3 --- /dev/null +++ b/front/fo/client/pages/sample2/index.vue @@ -0,0 +1,100 @@ + + + diff --git a/front/fo/nuxt.config.ts b/front/fo/nuxt.config.ts index 0b6ecfe..46ebabe 100644 --- a/front/fo/nuxt.config.ts +++ b/front/fo/nuxt.config.ts @@ -26,7 +26,7 @@ export default async () => { datePattern: 'YYYY-MM-DD-HH', }, server: { - type: configProperties.ServerType.NONE, + type: configProperties.ServerType.CONNECT, middleware: { compress: true, bodyParser: true, @@ -44,7 +44,7 @@ export default async () => { }, css: ['~/assets/global.scss'], head: { - titleTemplate: 'U.STRA Node Framework Sample - FO', + titleTemplate: 'U.STRA Node Framework Sample - FO %s', title: '', }, generation: { @@ -74,5 +74,6 @@ export default async () => { _config.env.SERVER_PROP_ENC_KEY = 'Z3NjLWNyeXB0by1rZXkxMQ==' _config.build.transpile.push('@ustra-sample/cmm') + _config.router.middleware.push('custom') }) } diff --git a/front/fo/package.json b/front/fo/package.json index ea6c9ea..44ea4ae 100644 --- a/front/fo/package.json +++ b/front/fo/package.json @@ -12,8 +12,10 @@ "IE >= 11" ], "scripts": { - "dev": "cross-env NODE_ENV=development CONFIG_ENV=local nuxt-ts dev --spa", - "generate": "rm -rf ./node_modules && cross-env NODE_ENV=production CONFIG_ENV=dev nuxt-ts generate --spa", + "dev": "cross-env NODE_ENV=development CONFIG_ENV=local nuxt dev", + "build": "cross-env NODE_ENV=development CONFIG_ENV=local nuxt build", + "start": "cross-env NODE_ENV=development CONFIG_ENV=local nuxt start", + "generate": "rm -rf ./node_modules && cross-env NODE_ENV=production CONFIG_ENV=dev nuxt generate", "test": "jest --detectOpenHandles --forceExit" }, "dependencies": {