File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,9 @@ function DisplayController() {
559
559
} ;
560
560
561
561
this . getIndicators = async ( req , res , next ) => {
562
- const data = await getIndicatorsData ( ) ;
562
+ const { symbol, interval} = req . query
563
+ console . log ( symbol , interval ) ;
564
+ const data = await getIndicatorsData ( `https://api3.binance.com/api/v3/klines?symbol=${ symbol } &interval=${ interval } ` ) ;
563
565
return res . status ( 200 ) . json ( {
564
566
message : "successfully" ,
565
567
error : null ,
Original file line number Diff line number Diff line change @@ -590,10 +590,8 @@ export const getLengthOfTransactionsList = async () => {
590
590
}
591
591
} ;
592
592
593
- export const getIndicatorsData = async ( ) => {
594
- const resp = await got (
595
- `https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1d`
596
- ) ;
593
+ export const getIndicatorsData = async ( urlApis ) => {
594
+ const resp = await got ( urlApis ) ;
597
595
const data = JSON . parse ( resp . body ) ;
598
596
let klinedata = data . map ( ( d ) => ( {
599
597
time : d [ 0 ] / 1000 ,
You can’t perform that action at this time.
0 commit comments