You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial/Access/EX-0-Access-Start/src/services.js
+62-7Lines changed: 62 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,30 @@
1
1
import{getAccessToken}from'./storage'
2
2
import{URLs}from'../../../tutorialsURLs'
3
3
4
-
const{DEMO_URL}=URLs
4
+
const{DEMO_URL,LIVE_URL}=URLs
5
5
6
-
exportconsttvGet=async(endpoint,query=null)=>{
6
+
/**
7
+
* Call to make GET requests to the Tradovate REST API. The passed `query` object will be reconstructed to a query string and placed in the query position of the URL.
Copy file name to clipboardExpand all lines: tutorial/Access/EX-1-Simple-Request/src/services.js
+56-11Lines changed: 56 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,24 @@
1
1
import{getAccessToken}from'./storage'
2
2
import{URLs}from'../../../tutorialsURLs'
3
3
4
-
const{DEMO_URL}=URLs
4
+
const{DEMO_URL,LIVE_URL}=URLs
5
5
6
-
exportconsttvGet=async(endpoint,query=null)=>{
6
+
/**
7
+
* Call to make GET requests to the Tradovate REST API. The passed `query` object will be reconstructed to a query string and placed in the query position of the URL.
Copy file name to clipboardExpand all lines: tutorial/Access/EX-2-Storing-A-Token/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
## Storing a Token
2
2
Now that we now how to get an access token, we really should store it locally. Fortunately, included with this project is a file called `storage.js`. This additional file contains functions that will let you set and retrieve items using `sessionStorage`. Using `sessionStorage` ensures that our temporary tokens will be cleared at the end of the session, and it also means that our apps will work even in browsers' Incognito mode.
3
3
4
+
> **Quick Tip!** From this section forward, you can use the developers' console to play with Tradovate REST API requests directly. Simply type `tradovate.get` or `tradovate.post` in the browser. These are functions that match `tvGet` or `tvPost` respectively, from `services.js`.
5
+
4
6
Let's see how our storage functions work. In `connect.js` we will make some changes:
Copy file name to clipboardExpand all lines: tutorial/Access/EX-2-Storing-A-Token/src/services.js
+62-7Lines changed: 62 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,30 @@
1
1
import{getAccessToken}from'./storage'
2
2
import{URLs}from'../../../tutorialsURLs'
3
3
4
-
const{DEMO_URL}=URLs
4
+
const{DEMO_URL,LIVE_URL}=URLs
5
5
6
-
exportconsttvGet=async(endpoint,query=null)=>{
6
+
/**
7
+
* Call to make GET requests to the Tradovate REST API. The passed `query` object will be reconstructed to a query string and placed in the query position of the URL.
0 commit comments