Multiple Bootup Scripts


#1

Hello, I am currently trying to run a Discord bot and trying to make a work around for the auto-sleep restriction. I have some code to ping the website every 4 and a half minutes. However, it does not seem like the script will start. Help!

Package.json:
{
"//1": “describes your app and its dependencies”,
"//2": “https://docs.npmjs.com/files/package.json”,
"//3": “updating this file will download and update your packages”,

“name”: “REEEEE”,
“version”: “1.0.0”,
“description”: “REEEEE”,
“main”: “server.js”,
“scripts”: {
“start”: “node server.js && node express.js”
},
“dependencies”: {
“discord.js”: “^11.2.1”,
“enmap”: “^0.3.2”,
“moment”: “^2.18.1”,
“moment-duration-format”: “^1.3.0”,
“express”: “^4.16.2”

},
“engines”: {
“node”: “8.x”
},
“repository”: {
“url”: “https://glitch.com/edit/#!/welcome-project
},
“license”: “MIT”,
“keywords”: [
“node”,
“glitch”,
“express”
]
}

express.js:

const http = require(‘http’);
const express = require(‘express’);
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
}, 280000);

(I have the PROJECT_DOMAIN set in the .env file)


#2

Are you seeing any error messages in your project logs? Let us know your project name and we can take a closer look.