A simple, single-page React application to showcase the structure of queries to the SDX.
- You need Node.js but this page for npm says not to use the Node installer! https://docs.npmjs.com/downloading-and-installing-node-js-and-npm "We strongly recommend using a Node version manager like nvm to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally." Instead, on Windows use Nodist or nvm-windows and on Apple or Linux use nvm. -I used Nodist here https://github.com/nodists/nodist/releases from the 'Installation' section but note that it says to uninstall Node first if you already have Node installed.
- Yarn (this requires Yarn 1 which can currently be found here: https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable) and you should be able to install the old Yarn by using npm install --global yarn
- Chrome or Firefox
- Navigate to https://sdxbeta.trihydro.com/
- Sign in with your credentials
- If you don't already have an account, use the Register button to sign up. You'll need to confirm your email before proceeding.
- Click the dropdown arrow by your name on the right-side of the menu bar
- Select API Access
- Use the Generate New API Key options to Generate an API Key
- Record your new API Key
- Clone this repository
- Install dependencies using
yarn install - Create a
.envfile in the project's root directory (at the same level as this README)- If on Linux or MacOS, this can be accomplished in the terminal by running
touch .env
- If on Linux or MacOS, this can be accomplished in the terminal by running
- Open the
.envfile. Add the following contents. Replace<api-key>with your API Key. Do not include any quotes or double quotes or angle brackets around the API Key.
DO NOT INCLUDE A TRAILING SLASH ON THE REACT_APP_URL!
DO NOT INCLUDE index.html
Either a trailing slash or /index.html will cause CORS to fail!
REACT_APP_API_KEY=<insert your apikey here>
REACT_APP_URL=https://sdxbeta-service.trihydro.com
- Start the application using
yarn start
After starting, the application should automatically load in your browser. If not, navigate to http://localhost:3000/. Note that the SDX application is set up to accept traffic from this application on port 3000 only. Other ports will fail CORS.
If you get a webpage at localhost:3000 but there seems to be no reaction at all to any button presses, the likely cause is that your .env file is incorrect.
Use the Query text area to modify query parameters. After a query has been run, results are displayed in the Results area.