🧃 Moving matchscorer to this service

This commit is contained in:
2021-08-01 16:15:58 -07:00
parent d46c2aedbb
commit 4e448f1f34
4 changed files with 11174 additions and 21 deletions

View File

@@ -2,6 +2,7 @@
import { Service, ServiceBroker, Context } from "moleculer";
import axios from "axios";
import {matchScorer} from "../utils/searchmatchscorer.utils";
const CV_BASE_URL = "https://comicvine.gamespot.com/api/";
const CV_API_KEY = "a5fa0663683df8145a85d694b5da4b87e1c92c69";
@@ -40,13 +41,24 @@ export default class GreeterService extends Service {
"?api_key=" +
CV_API_KEY,
params: ctx.params,
transformResponse: (r) => JSON.parse(r),
transformResponse: r => JSON.parse(r),
headers: { Accept: "application/json" },
});
const { data } = response;
return data;
},
},
getScoredComicVineMatches: {
rest: "/getscoredcomicvinematches",
params: {},
handler: async (
ctx: Context<{
}>
): Promise<any> => {
return matchScorer()
},
},
},
});
}