Browse Source

remove active stress-test

master
Rich Brown 8 months ago
parent
commit
bd73a392f1
1 changed files with 9 additions and 29 deletions
  1. +9
    -29
      index.js

+ 9
- 29
index.js View File

@@ -1,37 +1,17 @@
require("dotenv").config();

const { postTemp } = require("./weather");
const { randomPost } = require("./stress-test");

setInterval(() => {
randomPost(50, 500, 10);
}, 200);

// rando(50, 1000, process.env.RANDO_TOKEN);

postTemp(); // do it immediately
// setInterval(postTemp, 60000 * 60); // then, every hour

// no longer used: a little express server

// const express = require('express')
// const cors = require('cors')
// const axios = require('axios')
// const port = process.env.PORT || 3015

// const app = express()

// app.use(cors())
setInterval(postTemp, 60000 * 60); // then, every hour

// app.get('/:username', async (req, res) => {
// const { username } = req.params
// const data = await axios
// .get(`https://colors-ten.herokuapp.com/api/${username}`)
// .then(x => x.data)
// .catch((e) => console.log(e))
// res.json(data)
// })
/*
STRESS-TEST code, doesn't work without existing test## users
in database, so it's sort-of worthless now. but possibly re-usable.
*/

// app.get('*', (req, res) => res.send('bort.'))
// const { randomPost } = require("./stress-test");

// app.listen(port, () => console.log(`on ${port}`))
// setInterval(() => {
// randomPost(50, 500, 10);
// }, 200);

Loading…
Cancel
Save