Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ RUN pnpm --prod install

COPY . .

ENV OPENAI_API_KEY='' \
ASSISTANT_SECRET=''
ENV OPENAI_API_KEY=''

EXPOSE 3003
CMD [ "node", "main.js" ]
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ services:
- ./docs:/app/docs
environment:
- OPENAI_API_KEY
- ASSISTANT_SECRET
6 changes: 0 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ reference docs. For each question show code examples when applicable.
${prompt}`;

app.post("/", async (req, res) => {
const secret = req.headers.authorization;
if(secret !== process.env.ASSISTANT_SECRET) {
res.status(403);
res.send('Unauthorized access. Please make sure you are providing the authorized secret key.')
return;
}
// raw to text
const decoder = new TextDecoder();
const text = decoder.decode(req.body);
Expand Down