Skip to content

Commit

Permalink
Merge pull request #159 from CS3219-AY2425S1/fix/build-cycle
Browse files Browse the repository at this point in the history
update build cycle for api gateway
  • Loading branch information
lsyurea authored Nov 9, 2024
2 parents 62fee0b + 8d08746 commit 7d82477
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM node:18-alpine AS base

# Install pnpm globally
RUN npm install -g pnpm
RUN npm install -g typescript

# Set the working directory in the container
WORKDIR /app
Expand All @@ -22,7 +23,6 @@ COPY tsconfig.json ./

CMD ["pnpm", "dev"]


# Production stage
FROM base AS production
ENV NODE_ENV=production
Expand All @@ -33,4 +33,6 @@ COPY tsconfig.json ./

EXPOSE ${PORT}

RUN pnpm build

CMD ["pnpm", "start"]
2 changes: 1 addition & 1 deletion api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"dev": "nodemon --exec ts-node src/app.ts",
"start": "tsc && node dist/app.js",
"start": "node dist/app.js",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\"",
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
2 changes: 1 addition & 1 deletion api-gateway/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ app.use(express.json());
app.use(cors()); // configured so any one can use
app.options('*', cors());

// Health check route
// Health check route, redeploy
app.get('/', (req, res) => {
res.status(200).send('OK');
});
Expand Down

0 comments on commit 7d82477

Please sign in to comment.