add api key for endpoints
This commit is contained in:
parent
952b25578b
commit
8306a235a5
@ -30,7 +30,7 @@ async function createPortfolio(event) {
|
||||
const response = await fetch(fastifyURL+'/create-portfolio', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -16,6 +16,7 @@ let isLoaded = false;
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -77,7 +78,7 @@ const getAnalystEstimate = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/analyst-estimate', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -52,7 +54,7 @@ function latestInfoDate(inputDate) {
|
||||
const response = await fetch(apiURL + '/analyst-insight', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -191,7 +193,7 @@ function findLowestAndHighestFee(data, lastDateStr) {
|
||||
const response = await fetch(apiURL + '/borrowed-share', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
const response = await fetch(fastifyURL+'/buy-stock', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -173,7 +175,7 @@ const getClinicalTrial = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/clinical-trial', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -118,7 +118,7 @@ const handleUpvote = async (event) => {
|
||||
const response = await fetch(fastifyURL+'/upvote-comment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
}); // make a POST request to the server with the FormData object
|
||||
@ -154,7 +154,7 @@ const handleDownvote = async (event) => {
|
||||
const response = await fetch(fastifyURL+'/downvote-comment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
}); // make a POST request to the server with the FormData object
|
||||
@ -204,7 +204,7 @@ const handleDownvote = async (event) => {
|
||||
const response = await fetch(fastifyURL+'/delete-comment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
}); // make a POST request to the server with the FormData object
|
||||
|
||||
@ -34,7 +34,7 @@ async function updateSentiment(sentiment:string) {
|
||||
const response = await fetch('/api/community-sentiment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
}); // make a POST request to the server with the FormData object
|
||||
|
||||
@ -9,7 +9,7 @@ async function cookieConsent(state:string) {
|
||||
const response = await fetch('/api/cookies', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
}); // make a POST request to the server with the FormData object
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -184,7 +186,7 @@ const getDarkPool = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/dark-pool', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -144,7 +146,7 @@ const getEnterPriseValues = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/enterprise-values', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
@ -38,7 +40,7 @@ async function fetchData() {
|
||||
const response = await fetch(apiURL+'/get-executives', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -185,7 +187,7 @@ function findLowestAndHighestPrice(data, lastDateStr) {
|
||||
const response = await fetch(apiURL + '/fail-to-deliver', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
const response = await fetch(fastifyURL+'/feedback', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -41,7 +43,7 @@ const getFundamentalAnalysis = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/fundamental-predictor-analysis', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -162,7 +164,7 @@
|
||||
const response = await fetch(apiURL + '/government-contract', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -221,7 +223,7 @@ function findLowestAndhighestIV(data, lastDateStr) {
|
||||
const response = await fetch(apiURL + '/implied-volatility', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -101,7 +101,7 @@ const formData = new FormData(event.target); // create a FormData object from th
|
||||
const response = await fetch('/api/register', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(formData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -169,7 +171,7 @@ const getMarketMaker = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/market-maker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -371,4 +371,4 @@ onDestroy(() => {
|
||||
touch-action: none; /* or 'none' if manipulation doesn't work */
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
@ -9,6 +9,8 @@ export let data;
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -59,7 +61,7 @@ const getOptionsBubble = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/options-bubble', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -176,7 +178,7 @@
|
||||
const response = await fetch(apiURL + '/options-net-flow-ticker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
const response = await fetch(fastifyURL+'/create-price-alert', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -149,7 +151,7 @@ const getPriceAnalysis = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/price-analysis', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
let historyData = [];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -210,7 +212,7 @@ const getRetailVolume = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/retail-volume', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -156,7 +158,7 @@ const getRevenueSegmentation = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/revenue-segmentation', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -9,6 +9,8 @@ import { fade } from 'svelte/transition';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
@ -103,7 +105,7 @@ async function fetchData() {
|
||||
const response = await fetch(apiURL+'/get-sec-filings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
@ -40,7 +42,7 @@
|
||||
const response = await fetch(apiURL+'/searchbar-data', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ async function handleSellOrder()
|
||||
const response = await fetch(fastifyURL+'/sell-stock', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -50,7 +52,7 @@ const getSentimentAnalysis = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/sentiment-analysis', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -22,6 +22,8 @@ let putCallRatio;
|
||||
export let data;
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -103,7 +105,7 @@ const getShareholders = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/shareholders', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -124,7 +126,7 @@ const getShareStatistics = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/share-statistics', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -22,8 +22,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
@ -36,7 +38,7 @@
|
||||
const response = await fetch(apiURL+'/searchbar-data', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -77,4 +77,3 @@ function handleInput(event) {
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
@ -368,4 +368,3 @@ function handleImageInput(event) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -51,7 +53,7 @@ const getTrendAnalysis = async (ticker) => {
|
||||
const response = await fetch(apiURL + '/trend-analysis', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -36,7 +38,7 @@
|
||||
const response = await fetch(apiURL + '/value-at-risk', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
@ -140,7 +142,7 @@ async function getWatchlistData()
|
||||
const response = await fetch(apiURL+'/get-watchlist', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -26,7 +26,7 @@ export const trackPageVisit = async (path, userAgent) => {
|
||||
const response = await fetch(fastifyURL+'/mixpanel', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -47,7 +47,7 @@ export const trackPageDuration = async (path, userAgent, time) => {
|
||||
const response = await fetch(fastifyURL+'/mixpanel', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -69,7 +69,7 @@ export const trackPageError = async (path, userAgent, status, message) => {
|
||||
const response = await fetch(fastifyURL+'/mixpanel', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -88,7 +88,7 @@ export const trackAsset = async (symbol, assetType) => {
|
||||
const response = await fetch(fastifyURL+'/mixpanel', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -106,7 +106,7 @@ export const trackButtonClick = async (name) => {
|
||||
const response = await fetch(fastifyURL+'/mixpanel', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -7,7 +7,7 @@ async function loadNotifications(fastifyURL:string, userId:string) {
|
||||
const response = await fetch(fastifyURL+'/get-notifications', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -3,7 +3,7 @@ async function loadTwitchStatus(fastifyURL:string,) {
|
||||
const response = await fetch(fastifyURL+'/get-twitch-status', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -93,6 +93,8 @@ async function detectSWUpdate() {
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
let fastifyURL;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
@ -255,7 +257,7 @@ async function fallbackWorker() {
|
||||
const response = await fetch(fastifyURL+'/get-notifications', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -24,7 +24,7 @@ export const load = async ({parent}) => {
|
||||
const response = await fetch('https://api.github.com/repos/stocknear/frontend', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
});
|
||||
|
||||
@ -47,7 +47,7 @@ export const load = async ({parent}) => {
|
||||
const response = await fetch('https://api.github.com/repos/stocknear/backend', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -30,7 +32,7 @@ export const load = async ( { parent } ) => {
|
||||
const response = await fetch(apiURL + '/top-analysts', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async ({params}) => {
|
||||
const response = await fetch(apiURL + '/analyst-stats', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -28,7 +30,7 @@ export const load = async ({parent}) => {
|
||||
const response = await fetch(apiURL + '/top-analysts-stocks', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ const getDiscordWidget = async () => {
|
||||
const response = await fetch('https://discord.com/api/guilds/1165618982133436436/widget.json', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
const response = await fetch(fastifyURL+'/upvote', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
}); // make a POST request to the server with the FormData object
|
||||
@ -110,7 +110,7 @@
|
||||
const response = await fetch(fastifyURL+'/downvote', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
}); // make a POST request to the server with the FormData object
|
||||
@ -172,7 +172,7 @@
|
||||
const response = await fetch(fastifyURL+'/delete-post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -223,7 +223,7 @@
|
||||
const response = await fetch(fastifyURL+'/get-all-comments', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
@ -248,7 +248,7 @@
|
||||
const response = await fetch(fastifyURL + '/get-moderators', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(fastifyURL + '/get-one-post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -22,15 +22,13 @@
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
|
||||
let fastifyURL;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
fastifyURL = import.meta.env.VITE_USEAST_FASTIFY_URL;
|
||||
} else {
|
||||
apiURL = import.meta.env.VITE_EU_API_URL;
|
||||
fastifyURL = import.meta.env.VITE_EU_FASTIFY_URL;
|
||||
}
|
||||
});
|
||||
@ -357,7 +355,7 @@ const getModerators = async () => {
|
||||
const response = await fetch(fastifyURL + '/get-moderators', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
});
|
||||
|
||||
@ -391,7 +389,7 @@ const getUserStats = async () => {
|
||||
const response = await fetch(fastifyURL + '/get-user-stats', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -458,7 +456,7 @@ async function getPost() {
|
||||
const response = await fetch(fastifyURL+'/get-post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -17,15 +17,12 @@
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL = import.meta.env.VITE_EU_API_URL; // Set a default API URL
|
||||
let fastifyURL = import.meta.env.VITE_EU_FASTIFY_URL;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
fastifyURL = import.meta.env.VITE_USEAST_FASTIFY_URL;
|
||||
} else {
|
||||
apiURL = import.meta.env.VITE_EU_API_URL;
|
||||
fastifyURL = import.meta.env.VITE_EU_FASTIFY_URL;
|
||||
}
|
||||
});
|
||||
@ -62,7 +59,7 @@ const getUserData = async() => {
|
||||
const response = await fetch(fastifyURL+'/get-user-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -114,7 +111,7 @@ const getUserStats = async () => {
|
||||
const response = await fetch(fastifyURL + '/get-user-stats', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -142,7 +139,7 @@ const getModerators = async () => {
|
||||
const response = await fetch(fastifyURL + '/get-moderators', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
});
|
||||
|
||||
@ -176,7 +173,7 @@ async function getPost() {
|
||||
const response = await fetch(fastifyURL+'/get-post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/all-crypto-tickers', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let companyName;
|
||||
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
const fetchData = async (apiURL, endpoint, ticker) => {
|
||||
|
||||
@ -13,7 +14,7 @@ const fetchData = async (apiURL, endpoint, ticker) => {
|
||||
const response = await fetch(apiURL + endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -34,7 +35,7 @@ const fetchWatchlist = async (fastifyURL, userId) => {
|
||||
const response = await fetch(fastifyURL+'/all-watchlists', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -51,7 +52,7 @@ async function fetchPortfolio(fastifyURL, userId)
|
||||
const response = await fetch(fastifyURL+'/get-portfolio-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -67,6 +68,7 @@ export const load = async ({ params, locals, setHeaders}) => {
|
||||
const userRegion = locals.region?.split("::")[0];
|
||||
|
||||
let apiURL;
|
||||
|
||||
let fastifyURL;
|
||||
|
||||
if (usRegion?.includes(userRegion)) {
|
||||
|
||||
@ -20,6 +20,8 @@ const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let fastifyURL;
|
||||
let wsURL;
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
@ -45,7 +47,7 @@ async function loadSearchData() {
|
||||
const response = await fetch(apiURL+'/searchbar-data', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
@ -177,7 +179,7 @@ async function toggleUserWatchlist(watchListId: string) {
|
||||
const response = await fetch(fastifyURL + '/update-watchlist', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
@ -212,7 +214,7 @@ async function fetchPortfolio()
|
||||
const response = await fetch(fastifyURL+'/get-portfolio-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
@ -325,7 +327,7 @@ $: {
|
||||
const response = await fetch(apiURL+'/historical-price', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -3,6 +3,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -33,7 +35,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/congress-trading-ticker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -4,6 +4,7 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL = import.meta.env.VITE_EU_API_URL; // Set a default API URL
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -33,7 +34,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/stock-news', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -2,6 +2,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
@ -30,7 +32,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/get-quant-stats', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// lib/workers/test.ts
|
||||
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
async function getOneDayPrice(ticker: string, apiURL:string) {
|
||||
|
||||
@ -10,7 +11,7 @@ async function getOneDayPrice(ticker: string, apiURL:string) {
|
||||
const response = await fetch(apiURL + '/one-day-price', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -41,7 +42,7 @@ async function getHistoricalPrice(ticker: string, apiURL:string) {
|
||||
const response = await fetch(apiURL + '/historical-price', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -23,6 +23,8 @@ const checkMarketHour = async () => {
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -49,7 +51,7 @@ export const load = async ({parent}) => {
|
||||
const response = await fetch(apiURL + '/dark-pool-flow', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/dividends-calendar', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/earnings-calendar', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/economic-calendar', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/all-etf-tickers', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let companyName;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
function cleanString(input) {
|
||||
// Define a list of substrings to remove (case insensitive)
|
||||
@ -37,7 +39,7 @@ const fetchData = async (apiURL, endpoint, ticker) => {
|
||||
const response = await fetch(apiURL + endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -58,7 +60,7 @@ const fetchWatchlist = async (fastifyURL, userId) => {
|
||||
const response = await fetch(fastifyURL+'/all-watchlists', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -75,7 +77,7 @@ async function fetchPortfolio(fastifyURL, userId)
|
||||
const response = await fetch(fastifyURL+'/get-portfolio-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -90,6 +92,7 @@ export const load = async ({ params, locals, setHeaders}) => {
|
||||
const userRegion = locals.region?.split("::")[0];
|
||||
|
||||
let apiURL;
|
||||
|
||||
let fastifyURL;
|
||||
|
||||
if (usRegion?.includes(userRegion)) {
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
let fastifyURL;
|
||||
let wsURL;
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
@ -49,7 +51,7 @@ async function loadSearchData() {
|
||||
const response = await fetch(apiURL+'/searchbar-data', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
@ -188,7 +190,7 @@ async function toggleUserWatchlist(watchListId: string) {
|
||||
const response = await fetch(fastifyURL + '/update-watchlist', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
@ -222,7 +224,7 @@ async function fetchPortfolio()
|
||||
const response = await fetch(fastifyURL+'/get-portfolio-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
@ -340,7 +342,7 @@ async function historicalPrice(timePeriod:string) {
|
||||
const response = await fetch(apiURL+'/historical-price', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -439,7 +441,7 @@ async function initializePrice() {
|
||||
const response = await fetch(apiURL+'/pre-post-quote', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -3,6 +3,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -33,7 +35,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/congress-trading-ticker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -4,6 +4,7 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL = import.meta.env.VITE_EU_API_URL; // Set a default API URL
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -32,7 +33,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/stock-dividend', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -3,6 +3,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -33,7 +35,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/etf-holdings', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -33,7 +35,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/stock-news', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -3,6 +3,7 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL = import.meta.env.VITE_EU_API_URL; // Set a default API URL
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -46,7 +47,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/options-plot-ticker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
@ -107,7 +108,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/options-flow-ticker', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -2,6 +2,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
apiURL = import.meta.env.VITE_USEAST_API_URL;
|
||||
@ -30,7 +32,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/get-quant-stats', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -29,7 +31,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/all-etf-providers', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -3,7 +3,9 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiURL
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
;
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -36,7 +38,7 @@ export const load = async ({params}) => {
|
||||
const response = await fetch(apiURL + '/etf-provider', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/etf-new-launches', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -28,7 +30,7 @@ export const load = async ({parent}) => {
|
||||
const response = await fetch(apiURL + '/fda-calendar', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/heatmaps', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
@ -58,7 +60,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/heatmaps', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
@ -85,7 +87,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/heatmaps', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -3,6 +3,8 @@ import { userRegion, displayCompanyName, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion?.subscribe(value => {
|
||||
if (usRegion?.includes(value)) {
|
||||
@ -34,7 +36,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(apiURL + '/cik-data', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
});
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
if (usRegion.includes(value)) {
|
||||
@ -111,7 +113,7 @@ async function loadSearchData() {
|
||||
const response = await fetch(apiURL+'/searchbar-data', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ import { redirect } from '@sveltejs/kit';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -37,7 +39,7 @@ export const load = async ({ parent}) => {
|
||||
const response = await fetch(apiURL + '/market-movers', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
@ -62,7 +64,7 @@ export const load = async ({ parent}) => {
|
||||
const response = await fetch(apiURL + '/rss-feed-wiim', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -32,7 +34,7 @@ export const load = async ({params}) => {
|
||||
const response = await fetch(apiURL + '/ipo-calendar', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -32,7 +34,7 @@ export const load = async ({params}) => {
|
||||
const response = await fetch(apiURL + '/ipo-calendar', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -169,7 +169,7 @@ async function getLeaderboard() {
|
||||
const response = await fetch(fastifyURL+'/leaderboard', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -44,7 +44,7 @@ export const load = async ({ params }) => {
|
||||
const response = await fetch(fastifyURL+'/leaderboard', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -29,7 +31,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/etf-bitcoin-list', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -29,7 +31,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/delisted-companies', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -30,7 +32,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/exchange-constituents', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
@ -4,6 +4,8 @@ import { userRegion, getCache, setCache } from '$lib/store';
|
||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
||||
|
||||
let apiURL;
|
||||
let apiKey = import.meta.env.VITE_STOCKNEAR_API_KEY;
|
||||
|
||||
|
||||
userRegion.subscribe(value => {
|
||||
|
||||
@ -31,7 +33,7 @@ export const load = async () => {
|
||||
const response = await fetch(apiURL + '/filter-stock-list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
body: JSON.stringify(postData),
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user