diff --git a/api/Lookup/function.json b/api/Lookup/function.json new file mode 100644 index 0000000..46652d8 --- /dev/null +++ b/api/Lookup/function.json @@ -0,0 +1,19 @@ +{ + "bindings": [ + { + "authLevel": "anonymous", + "type": "httpTrigger", + "direction": "in", + "name": "req", + "methods": [ + "get", + "post" + ] + }, + { + "type": "http", + "direction": "out", + "name": "res" + } + ] +} \ No newline at end of file diff --git a/api/Lookup/index.js b/api/Lookup/index.js new file mode 100644 index 0000000..b7eb06b --- /dev/null +++ b/api/Lookup/index.js @@ -0,0 +1,34 @@ +const { SearchClient, AzureKeyCredential } = require("@azure/search-documents"); + +const indexName = process.env["SearchIndexName"]; +const apiKey = process.env["SearchApiKey"]; +const searchServiceName = process.env["SearchServiceName"]; + +// Create a SearchClient to send queries +const client = new SearchClient( + `https://` + searchServiceName + `.search.windows.net/`, + indexName, + new AzureKeyCredential(apiKey) +); + +module.exports = async function (context, req) { + + //context.log(req); + + // Reading inputs from HTTP Request + const id = (req.query.id || (req.body && req.body.id)); + + // Returning the document with the matching id + const document = await client.getDocument(id) + + context.log(document); + + context.res = { + // status: 200, /* Defaults to 200 */ + headers: { + "Content-type": "application/json" + }, + body: { document: document} + }; + +}; \ No newline at end of file diff --git a/frontend/public/images/research-paper.png b/frontend/public/images/research-paper.png new file mode 100644 index 0000000..de07384 Binary files /dev/null and b/frontend/public/images/research-paper.png differ diff --git a/frontend/src/components/Results/Result/Result.js b/frontend/src/components/Results/Result/Result.js index a10321b..a2b2918 100644 --- a/frontend/src/components/Results/Result/Result.js +++ b/frontend/src/components/Results/Result/Result.js @@ -3,11 +3,15 @@ import React from 'react'; import './Result.css'; export default function Result(props) { - return( -