From 675f74c04650978dd19e30584c80f4eb0018f60d Mon Sep 17 00:00:00 2001 From: William Bergeron-Drouin Date: Mon, 9 Sep 2024 12:10:36 -0400 Subject: [PATCH 1/2] Add basic auth --- .env.example | 6 +++++- src/pages/api/[...path].ts | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f670030..880bfae 100644 --- a/.env.example +++ b/.env.example @@ -25,4 +25,8 @@ NEXT_OTEL_VERBOSE=0 # Inference INFERENCE_URL=http://127.0.0.1:8001 INFERENCE_MODEL_NAME=summarizer_medical_journals_qa -INFERENCE_MODEL_VERSION=120240905190000 \ No newline at end of file +INFERENCE_MODEL_VERSION=120240905190000 + +# Atlas credentials +ATLAS_ROOT_USER=root +ATLAS_ROOT_PASSWORD=changeme \ No newline at end of file diff --git a/src/pages/api/[...path].ts b/src/pages/api/[...path].ts index bf52060..f360bec 100644 --- a/src/pages/api/[...path].ts +++ b/src/pages/api/[...path].ts @@ -19,6 +19,9 @@ async function proxy(req: NextApiRequest, res: NextApiResponse) { req.url = req.url.replace('/api', ''); } + // We need to add basic auth + req.headers.authorization = `Basic ${Buffer.from(`${process.env.ATLAS_ROOT_USER}:${process.env.ATLAS_ROOT_PASSWORD}`).toString('base64')}`; + proxyServer.web( req, res, From 41a050ca3f2e9a9644c5511f453ffa70e18a1e95 Mon Sep 17 00:00:00 2001 From: William Bergeron-Drouin Date: Mon, 9 Sep 2024 12:11:45 -0400 Subject: [PATCH 2/2] Fix dom nesting --- src/components/article-hit.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/article-hit.tsx b/src/components/article-hit.tsx index e6dee3d..ab1c2a5 100644 --- a/src/components/article-hit.tsx +++ b/src/components/article-hit.tsx @@ -42,9 +42,12 @@ export const ArticleHit = ({ hit }: { hit: Hit
}) => {

{hit.resource.data.title}

-

- {highestHitsHighlight && } -

+ {highestHitsHighlight && ( + + )} {/* {passageHighlight && } */}
);