agusvalori
agusvalori
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
I managed to solve it by pasting the code into a POST function that only returns the articles.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
The paths are correct; at least the data isn't being erased with each deployment. I accessed the volume through the volume file browser, and I could also see the images there. I can access them from the other route. I'm not sure if you managed to change the category to "Aluminum"; only two articles have images.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
In the same Railway, in a volume.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
Here's the link to Railway. https://appweb-myvdescartables.up.railway.app/catalogo If you look within the catalog tab, the images don't appear, but if you select from the middle dropdown where it says "seleccionar categoria" and choose "Aluminio" (Only the first two articles have loaded images), you'll see that now the image appears. The code is almost the same; only the MongoDB find() has changed, which in this case only says: const products = await Product.find({ CATEGORIA: categoriaName})
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
Yes, I see the logs in the Visual Studio Code terminal. I can also see the images as soon as the page loads on localhost. However, when I do it from Railway using the same build and deployment commands as locally, I can't see the images, and I also can't see the console.log() from a route. Later, in other routes, it shows them to me; I'm trying to change the GET code and still have the same problem—it's like it can't fetch the image routes but sends the articles to the client while avoiding parts of the code. Then I have similar codes, even one very similar, and it doesn't have that problem; it shows the console.log() that is always on the first line and sends all the data to the client.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
Yes. It works fine, it's just that I can't see the console.log() messages, and then when I put the complete code, some images in the articles don't load. I have the same code in another route, but the difference is that when fetching the articles from MongoDB, it only gets the articles that match a subcategory. const products = await Product.find() const products = await Product.find({ CATEGORIA: categoriaName}) And this one does show all console.log() messages and the images on the client.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
I managed to build the app and also added in Railway that I used the same command npx next build. The issue I'm facing is that it doesn't show me the commands. The strange thing is that if I perform a NextResponse, I can get it from the client, but it doesn't show me the console.log(). In fact, I simplified the GET function to a NextResponse and a console.log, and that's what happens. const GET = async () => { console.log("GET catalogo/"); return NextResponse.json({ message: "GET catalogo/", data: [], }); } export { GET }; In the client's server, I get the correct message, but in the terminal, I don't see the console.log().
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
No description
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
npx next dev ▲ Next.js 14.0.3 - Local: http://localhost:3000 - Environments: .env.local ✓ Ready in 4.5s ○ Compiling /catalogo ... ✓ Compiled /catalogo in 5.5s (2538 modules) ○ Compiling /api/catalogo/categorias ... ✓ Compiled /api/catalogo/categorias in 3.1s (1355 modules) ✓ Compiled (1357 modules) GET catalogo/ GET productos- categorias Base de datos conectada: * undefined Base de datos conectada: * myvdescartablesdb ✓ Compiled /api/catalogo/[articuloID]/imagenes/[imageName] in 298ms (1359 modules) GET catalogo/ GET productos- categorias Base de datos conectada: * myvdescartablesdb Base de datos conectada: * myvdescartablesdb
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
With the nextjs npm run dev command.
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
No description
26 replies
RRailway
Created by agusvalori on 3/18/2024 in #✋|help
Problems getting images and displaying console.log() on a Railway deployment
ID:a85b4083-30a6-432a-b467-33c809a8c6f7
26 replies
RRailway
Created by agusvalori on 2/21/2024 in #✋|help
Issue with Saving Product Images to Railway Volume
Thank you very much! I think it's working now, on each deploy it doesn't delete the images anymore.
14 replies
RRailway
Created by agusvalori on 2/21/2024 in #✋|help
Issue with Saving Product Images to Railway Volume
Perfect, thank you very much. Now I'll try and see what comes up. Yes, I added the line break because I have several console logs. Because since I didn't know where the files were being saved, I used them to explore the volume folder with the other console logs.
14 replies
RRailway
Created by agusvalori on 2/21/2024 in #✋|help
Issue with Saving Product Images to Railway Volume
Sorry, here is the console log. const rootImagePath = ``${process.cwd()}/src/uploads/images``; console.log("rootImagePath: ", rootImagePath, "\n"); rootImagePath: /app/src/uploads/images
14 replies
RRailway
Created by agusvalori on 2/21/2024 in #✋|help
Issue with Saving Product Images to Railway Volume
I MISSED THE FOLLOWING FROM THE CODE: const directoryPath = `${rootImagePath}/products/${articuloID}; HOW CAN I PASS THE COMPLETE CODE?
14 replies
RRailway
Created by agusvalori on 2/21/2024 in #✋|help
Issue with Saving Product Images to Railway Volume
Project ID:a85b4083-30a6-432a-b467-33c809a8c6f7
14 replies