Error Discord - Glitch CODE

Using : NodeJS
Error in line 4 of code:

  1. //CODE GLITCH
  2. const http = require(‘http’);
  3. const express = require(‘express’);
    const app = express();

//
app.use(express.static(‘public’));

app.get("/", function (request, response) {
response.sendFile(__dirname + ‘/views/index.html’);
});

app.get("/", (request, response) => {
response.sendStatus(200);
});

app.listen(process.env.PORT);

setInterval(() => {
http.get( http://${process.env.PROJECT_DOMAIN}.glitch.me/ );
}, 280000);

IN LOG:

at Object. (/app/server.js:4:17)

6:11 PM

at Module._compile (module.js:653:30)

6:11 PM

at Object.Module._extensions…js (module.js:664:10)

6:11 PM

at Module.load (module.js:566:32)

6:11 PM

at tryModuleLoad (module.js:506:12)

6:11 PM

at Function.Module._load (module.js:498:3)

You need help, and it’s not with line 4. Not yet. You need help with how you read an error message.

Computers aren’t actually so cheeky as to say “there’s something wrong on line 4 but I won’t tell you what’s wrong.” It’s supposed to say what’s wrong in the error printout, and it looks like you’ve cut that off in the part you copied here.

In the case of Glitch, you might have to scroll up in the log panel to see it.

9 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.