mirror of
https://github.com/anatolykopyl/status.git
synced 2026-03-26 12:54:46 +00:00
Токен в .env и новый стиль
This commit is contained in:
@@ -8,16 +8,18 @@ import { httpsReq } from "./httpsReq.js";
|
||||
dotenv.config();
|
||||
|
||||
const app = Express();
|
||||
const port = process.env.PORT || 5001;
|
||||
|
||||
const port = process.env.PORT || 5000;
|
||||
const statusIds = [1, 2, 3, 4, 5, 9, 10, 17, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 38, 39];
|
||||
|
||||
app.use(Cors());
|
||||
|
||||
app.get('/update', (req, res) => {
|
||||
let id = Math.floor(Math.random() * 34);
|
||||
let url = `https://api.vk.com/method/users.setCovidStatus?access_token=1f3a7a0c80ba9d1e4af5b3e9ac583c98aa6d036be89c2508f4486913b1cbdb125a9a8c4440b6dbb57f348&status_id=${id}&v=5.103`;
|
||||
var id = statusIds[Math.floor(Math.random() * statusIds.length)];
|
||||
let url = `https://api.vk.com/method/users.setCovidStatus?access_token=${process.env.TOKEN}&status_id=${id}&v=5.103`;
|
||||
httpsReq(url).then(() => {
|
||||
res.send();
|
||||
console.log(response);
|
||||
res.redirect("https://status.anatolykopyl.ru");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user