Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
troubles for deploying node js on heruko

I am new to node js and I made a blog app to practice CRUD. I decided to deploy my app and I'm getting strange errors "I did all the steps from documentation".

Here is my error:

at=error code=H12 desc="Request timeout" method=GET path="/" host=simple-blog-amirali.herokuapp.com request_id=9a3b0f46-1470-4ed0-ba43-4f42824ea252 fwd="185.107.80.219" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=http

And my server.js here:

const express = require("express");
const app = express();
const mongoose = require("mongoose");
const Article = require("./models/article");
const articleRouter = require("./routes/articles");
require('dotenv').config()
const port = process.env.PORT || 3000;
const methodOverride = require("method-override");

mongoose.connect(process.env.MONGODB_URI || "mongodb://localhost/blog");

app.set("view engine", "ejs");

app.use(express.static("./public"));
app.use(express.urlencoded({ extended: false }));
app.use(methodOverride("_method"));
app.use("/articles", articleRouter);

app.get("/", async (request, response) => {
  const articles = await Article.find().sort({ createdAt: "desc" });
  response.render("articles/index", { articles: articles });
});

app.listen(port, () => {
  console.log(`Listening on port: ${port}`);
});
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!