Skip to content

Commit

Permalink
Update to work with AWS deployments.
Browse files Browse the repository at this point in the history
  • Loading branch information
funnylookinhat committed Feb 10, 2022
1 parent 7c5dc19 commit 1bbd26b
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 116 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Reason's compiler generates JavaScript from `*.re` files. From there we need
help stitching everything together into a bundle for the browser. Think of how
Babel and Webpack work together, and you've got the right idea.

**Required: You must be on Node v12** (e.g. `nvm install 12 && nvm use 12`)

First get your dependencies with `yarn install` (or `npm install` if that's how
you roll).

Expand Down
11 changes: 8 additions & 3 deletions lib/clients/feedstore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const request = require('request-promise-native');

const HOST = 'http://stage.roger.dal.moz.com';
const BASE_URL = '/feedstore-prod/related';
const HOST = 'http://superfeedstore.data-platform-prod.aws.moz.com';
const BASE_URL = '/superfeedstore/related';
const LOCALE = 'en-US';

const TYPES = {
Expand Down Expand Up @@ -56,7 +56,12 @@ const options = ({ keyword, type }) => ({
});

const fetch = async ({ keyword, type }) => {
return request(options({ keyword, type }));
try {
return request(options({ keyword, type }));
} catch (err) {
console.log({ log: `Feedstore Request Error`, err, options: options({ keyword, type })})
throw err;
}
};

const fetchTypes = async ({ keyword, type }) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const server = http.createServer(async (req, res) => {
res.setHeader('Content-Type', 'application/json');
res.write(JSON.stringify(result, null, 2));
} catch (err) {
console.log({ log: 'search error', err });
console.log({ log: 'search error', err, js: err.options.json });
} finally {
return res.end();
}
Expand Down
Loading

0 comments on commit 1bbd26b

Please sign in to comment.