Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda