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

210
Views
404 Not Found for index.html in Google App Engine - How to get page to show up?

I am trying to host my project with Google App Engine and I am unable to get my pages to show up. My package.json looks like this

  "name": "final",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "scripts": {
    "start": "node app.js"
}

My app.js looks like this :

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

app.get('/', (req, res) => {
  res.sendFile('/index.html');
});

// Listen to the App Engine-specified port, or 8080 otherwise
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}...`);
});

When I deploy, the page just says Not Found and gives me a 404. Is there something I need to do with my index.html and subsequent .js files it uses or is my entire directory uploaded whenever I deploy? Error logs give me nothing other than the 404.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to specify the full path of index.html

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

app.get('/', (req, res) => {
  res.sendFile(path.join(__dirname, '/index.html'));
});

// Listen to the App Engine-specified port, or 8080 otherwise
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}...`);
});
about 4 years ago · Juan Pablo Isaza Report
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!