Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with AWS deployments. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ 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).

Next: run `yarn app:build` to make sure everything necessary for webpack is pre-built.

From there, open 3 CLI tabs to get up and running:

- `./bin/server.js [PORT]` to start the web server. `PORT` is optional and
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