init commit

This commit is contained in:
2025-11-07 22:24:40 +01:00
parent a5373286bf
commit 15b8f36d4d
217 changed files with 168229 additions and 0 deletions

21
server/scripts/dollarToRial.ts Executable file
View File

@@ -0,0 +1,21 @@
import * as redis from '../api/redis'
const fetch = require('node-fetch');
export const addDollarPrice = () => {
fetch("https://api.tgju.online/v1/data/sana/json")
.then(res => res.json())
.then( json => {
const price = Number(json['sana']['data'][16]['p'])
redis.hashset("dollarPrice", price)
.then((added) => {
console.log("price of dollar added to redis" , added)
})
.catch((err) => {
console.log("error is ", err)
})
})
.catch((err) => {
console.log("error is", err )
})
}