Skip to content

Commit

Permalink
fix: use correct content type for chat api (#279)
Browse files Browse the repository at this point in the history
* fix: use correct content type for chat api

* fix: docker build (#185)

* fix: fix libcrypto3 vulnerability

---------

Co-authored-by: Aliaksei Kryvasheyeu <[email protected]>
  • Loading branch information
mikitabut and akryvasheyeu authored Dec 4, 2023
1 parent ff86066 commit f8530ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# ---- Base Node ----
FROM node:20-alpine AS base
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
WORKDIR /app
COPY /tools ./tools
COPY package*.json ./

# ---- Dependencies ----
FROM base AS dependencies
RUN npm ci --omit=optional
RUN npm ci

# ---- Build ----
FROM dependencies AS build
Expand All @@ -15,6 +16,7 @@ RUN npm run build

# ---- Production ----
FROM node:20-alpine AS production
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
Expand Down
1 change: 1 addition & 0 deletions src/pages/api/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
jobTitle: token?.jobTitle as string,
});
res.setHeader('Transfer-Encoding', 'chunked');
res.setHeader('Content-Type', 'text/event-stream');

const reader = stream.getReader();
const processStream = async () => {
Expand Down

0 comments on commit f8530ca

Please sign in to comment.