I’m here for help with my Glitch project, the problem is that my project’s website is still loading when trying to response from .ejs file (response.render()) and then it returns with “Site didn’t respond”. Other things like response.sendFile works fine. What do I do?
Here’s my code:
const express = require("express");
const app = express();
const client = require("./index.js")
const ejs = require("ejs")
const dreams = [
"Find and count some sheep",
"Climb a really tall mountain",
"Wash the dishes"
]; // noob
app.set('view engine', 'ejs');
app.use(express.static("public"));
app.get("/", (request, response) => {
// response.sendFile(__dirname + "/views/index.html");
response.render("index", client, {async: true})
});
// listen for requests :)
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});