소스 검색

deploy heroku

김보경 5 년 전
부모
커밋
965cf049c0
4개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 0
      Procfile
  2. 1 0
      nuxt.config.js
  3. 2 1
      package.json
  4. 5 8
      server/keys/prod.js

+ 1 - 0
Procfile

@@ -0,0 +1 @@
+web: nuxt start

+ 1 - 0
nuxt.config.js

@@ -67,6 +67,7 @@ module.exports = {
   ** See https://axios.nuxtjs.org/options
   */
   axios: {
+    baseURL: process.env.BASE_URL || 'http://localhost:3000'
   },
   serverMiddleware: [
     '~/server/routes/index'

+ 2 - 1
package.json

@@ -8,7 +8,8 @@
     "dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
     "build": "nuxt build",
     "start": "cross-env NODE_ENV=production node server/index.js",
-    "generate": "nuxt generate"
+    "generate": "nuxt generate",
+    "heroku-postbuild": "npm run build"
   },
   "dependencies": {
     "@nuxtjs/axios": "^5.3.6",

+ 5 - 8
server/keys/prod.js

@@ -1,10 +1,7 @@
-// module.exports = {
-//   DB_URI: process.env.DB_URI,
-//   SESSION_SECRET: process.env.SESSION_SECRET
-// }
+module.exports = {
+  DB_URI: process.env.DB_URI,
+  SESSION_SECRET: process.env.SESSION_SECRET
+}
 
 
-module.exports = {
-  DB_URI: 'mongodb+srv://testuser:testuser@cluster0-szos0.mongodb.net/promo-db?retryWrites=true&w=majority',
-  SESSION_SECRET: 'asd!asd@@@'
-}
+// mongodb+srv://secretUser:secret123@cluster0-l4wtq.mongodb.net/promo-db?retryWrites=true&w=majority