Skip to content

Commit

Permalink
server build 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
eastshine94 committed Oct 4, 2020
1 parent b6094ce commit 239bbbc
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum PAGE_PATHS {
CHATTING_ROOM = '/room',
}

export const HOST = process.env.HOST || 'http://localhost:3001';
export const HOST = process.env.HOST || 'http://localhost:8001';

export const API_HOST = process.env.API_HOST || `${HOST}/api`;

Expand Down
4 changes: 2 additions & 2 deletions server/nodemon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"watch": ["server/app.ts"],
"watch": ["server/src/**/*.ts"],
"ext": "ts",
"exec": "NODE_ENV=development ts-node ./server/app.ts"
"exec": "NODE_ENV=development ts-node ./server/src/web.ts"
}
4 changes: 3 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc",
"start": "yarn build & node ./build/web.js"
},
"author": "",
"license": "ISC",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/app.ts → server/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const stopServer = async (server: http.Server, sequelize: Sequelize, signal?: st
const runServer = async() => {
const app = express();
const sequelize = DB.init();
app.set('port', process.env.PORT || 3001);
app.set('port', process.env.PORT || 8001);
app.use(express.json());
app.use(cors());
app.use('/api/auth', authRouter);
Expand Down
24 changes: 24 additions & 0 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"strict": true,
"baseUrl": "./",
"outDir": "build",
"sourceMap": false,
"removeComments": true,
"experimentalDecorators": true,
"target": "es6",
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"importHelpers": true,
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts",
"build",
]
}

0 comments on commit 239bbbc

Please sign in to comment.