Skip to content

Commit

Permalink
[Add] backend 배포 시도
Browse files Browse the repository at this point in the history
  • Loading branch information
kyujonglee committed Oct 24, 2019
1 parent f4731ec commit 978d480
Show file tree
Hide file tree
Showing 5 changed files with 377 additions and 21 deletions.
1 change: 1 addition & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ public/
# DynamoDB Local files
.dynamodb/

build
6 changes: 5 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
"author": "이규종 <kyujong93@naver.com>",
"license": "MIT",
"scripts": {
"dev": "nodemon --exec babel-node src/server.js"
"dev": "nodemon --exec babel-node src/server.js --delay 2",
"build": "babel src --out-dir build",
"postbuild": "copy ./src/api/**/*.graphql ./build/api",
"start": "NODE_ENV=production yarn run build && pm2 start build/server.js"
},
"dependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/node": "^7.6.3",
"@babel/plugin-transform-runtime": "^7.6.2",
Expand Down
15 changes: 10 additions & 5 deletions server/src/config/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import dotenv from 'dotenv';
dotenv.config();

module.exports = {
development: {
username: 'airbnb',
Expand All @@ -18,11 +21,13 @@ module.exports = {
operatorsAliases: false
},
production: {
username: 'root',
password: null,
database: 'database_production',
host: '127.0.0.1',
username: process.env.DB_NAME,
password: process.env.DB_PASSWORD,
database: 'membership_airbnb',
host: process.env.DB_PORT,
dialect: 'mysql',
operatorsAliases: false
operatorsAliases: 'no-op',
charset: 'utf8',
collate: 'utf8_general_ci'
}
};
1 change: 1 addition & 0 deletions server/src/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '@babel/polyfill';
import './env';
import { GraphQLServer } from 'graphql-yoga';
import logger from 'morgan';
Expand Down
Loading

0 comments on commit 978d480

Please sign in to comment.