aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-10-30 16:52:16 -0400
committerab <abdullah_ahmed@brown.edu>2019-10-30 16:52:16 -0400
commit96c572d67ea44242a34be4dae359c35677b25098 (patch)
treee66961a99ce80779c37380d5e555f864ed039603 /src/server
parentdb786c9a809b53ff0b613eec0c49b207dca07646 (diff)
ibm server request works!
Diffstat (limited to 'src/server')
-rw-r--r--src/server/index.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/index.ts b/src/server/index.ts
index 9cc504c93..d866b5b73 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -57,6 +57,7 @@ import { ParsedPDF } from "./PdfTypes";
import { reject } from 'bluebird';
import { Result } from '../client/northstar/model/idea/idea';
import RouteSubscriber from './RouteSubscriber';
+import { IBM_Recommender } from '../client/apis/IBM_Recommender';
const download = (url: string, dest: fs.PathLike) => request.get(url).pipe(fs.createWriteStream(dest));
let youtubeApiKey: string;
@@ -776,6 +777,12 @@ addSecureRoute({
addSecureRoute({
method: Method.POST,
+ subscribers: "/IBMAnalysis",
+ onValidation: async (_user, req, res) => res.send(await IBM_Recommender.analyze(req.body))
+});
+
+addSecureRoute({
+ method: Method.POST,
subscribers: RouteStore.dataUriToImage,
onValidation: (_user, req, res) => {
const uri = req.body.uri;