import fetch from 'fetch'
const response = async () => await fetch ('https://ipapi.co/json/')
.then (response => response.json ())
const IPuser = response.ip
const dov = "IP" // АЙПИ опреленного человека
if (dov != IPuser) {
//..native code
}
import axios from 'axios'
const { data } = axios.get ('https://example.com')
import fetch from 'fetch'
(async () => {
const promise = await fetch ('https://example.com', ...params)
})()
import request from 'request'
(async () => {
const req = await request ('https://example.com')
})()
const { default: axios } = require('axios');
const amout = require('./type'); // можете сделать .js, но он и так найдет.
async function crystal() {
const response = await axios.get('https://api.crystalpay.ru/v1/?', {
params: {
s: '',
n: '',
o: 'invoice-create',
amount: amout,
lifetime: '1440',
callback: 'localhost',
extra: ''
}
})
// console.log(response);
return response.data.id
}
module.exports.crystal = crystal
module.exports = 10