Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

319
Vistas
Loading Images in Phaser and Node js

Im am trying to load images in phaser with node js and i always get the same error

:3000/assets/img/feet/idle/survivor-idle_0.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)

if you know a way to get this to work please tell me. here is my code:

preload() {
    // Used for preloading assets into your scene
    //Idle feet image
    this.load.image('idleFeetFrame', '/assets/img/feet/idle/survivor-idle_0.png');
}

(Updated from Comment) ... is my server code:

const express = require('express');
const app = express();
const server = app.listen(process.env.PORT || 3000);
app.use(express.static('./public'));
console.clear();
console.log('\x1b[36m%s\x1b[0m', 'Server started...\n');
const socket = require('socket.io');
const io = socket(server);
io.sockets.on('connection', handleConnection);

function handleConnection(socket) { console.log('Client: ' + socket.id + ' has connected.') }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Since there are not any special routes configured in express, I assume all your files are in the folder ./public.

In that case the file survivor-idle_0.png would have to be in the folder ./public/assets/img/feet/idle/survivor-idle_0.png if you can't find it in that path, that is the problem (check for typos, or extra folder like src).

As long as you are not using a bundler like webpack, parcel or so, just need to check your the public folder and fix the paths.
If you are using a bundler, you will have to check the bundler configuration for errors.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda