🧃 Moving matchscorer to this service
This commit is contained in:
@@ -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()
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user