@jajoosam/

kron-test

Express

No description

fork
loading
Files
  • index.js
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8061901679503809","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Ly8gQ2hhbmdlIHRoaXMg8J+Rhwp2YXIgbGluayA9IGBodHRwczovL2tyb24tdGVzdC5qYWpvb3NhbS5yZXBsLmNvL3BpbmdgOwp2YXIgaW50ZXJ2YWwgPSA1OyAvL3NlY29uZHMKCmNvbnN0IGV4cHJlc3MgPSByZXF1aXJlKCdleHByZXNzJyk7CmNvbnN0IGFwcCA9IGV4cHJlc3MoKTsKY29uc3QgYXhpb3MgPSByZXF1aXJlKCdheGlvcycpOwoKYXBwLnVzZShleHByZXNzLnN0YXRpYygncHVibGljJykpOwoKYXBwLmdldCgnLycsIChyZXEsIHJlcykgPT4gewoJcmVzLnNlbmQoJ0hlbGxvIEV4cHJlc3MgYXBwJyk7Cn0pOwoKYXBwLmdldCgnL3BpbmcnLCAocmVxLCByZXMpID0+IHsKICB2YXIgbnVtID0gcGFyc2VJbnQocmVxLnF1ZXJ5Lm51bSk7Cgljb25zb2xlLmxvZyhgUGluZyAjJHtudW19YCk7CiAgbnVtKys7CgkvL2F4aW9zLmdldChgaHR0cHM6Ly9rcm9uLmZ1bi8/dGltZT0ke2ludGVydmFsfSZ1cmw9JHtlbmNvZGVVUklDb21wb25lbnQobGluaysgJz9udW09JyArIG51bSl9YCkKCXJlcy5zZW5kKCdPSycpOwp9KTsKCmNvbnNvbGUubG9nKGBHbyB0byBodHRwczovL2tyb24uZnVuLz90aW1lPSR7aW50ZXJ2YWx9JnVybD0ke2VuY29kZVVSSUNvbXBvbmVudChsaW5rKSArICc/bnVtPTEnfSB0byBzdGFydCB0aGlzIG9mZi5gKQoKYXBwLmxpc3RlbigzMDAwLCAoKSA9PiBjb25zb2xlLmxvZygnc2VydmVyIHN0YXJ0ZWQnKSk7"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Change this 👇
var link = `https://kron-test.jajoosam.repl.co/ping`;
var interval = 5; //seconds

const express = require('express');
const app = express();
const axios = require('axios');

app.use(express.static('public'));

app.get('/', (req, res) => {
	res.send('Hello Express app');
});

app.get('/ping', (req, res) => {
  var num = parseInt(req.query.num);
	console.log(`Ping #${num}`);
  num++;
	//axios.get(`https://kron.fun/?time=${interval}&url=${encodeURIComponent(link+ '?num=' + num)}`)
	res.send('OK');
});

console.log(`Go to https://kron.fun/?time=${interval}&url=${encodeURIComponent(link) + '?num=1'} to start this off.`)

app.listen(3000, () => console.log('server started'));