lennard.
lennard.
RRailway
Created by lennard. on 6/13/2023 in #✋|help
Getting this error on my web-page
Hey. I am currently getting such an error: upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: immediate connect error: Cannot assign requested address. What can the cause for that be?
16 replies
RRailway
Created by lennard. on 6/6/2023 in #✋|help
ExpressJS app not responding
Hello! I am currently trying to deploy my ExpressJS app with only one basic feature. It works on localhost. But on the deployed domain I see none of the console log's in the deploy page and also get no responses when making API requests to it, using CURL. Here's my code:
import express from "express";
import { Readable } from "stream";
const app = express();

const messages = ['Hey!', 'How are you?', 'Thanks suXin for help :birb:'];

app.get('/', (req, res) => {
console.log("New request");
var i = 0;
res.setHeader('Content-Type', 'text/plain');

const readable = new Readable();
readable._read = () => {}; // Required for a readable stream

const interval = setInterval(() => {
readable.push(`${messages[i]}\n`);
console.log(messages[i]);
i++;

if (i >= messages.length) {
clearInterval(interval);
readable.push(null);
}
}, 1000);

readable.pipe(res);
});

app.get("/health", (req, res) => {
res.status(200).send({
status: "OK"
});
})

app.listen(3000, () => {
console.log("Listening on port 3000");
});
import express from "express";
import { Readable } from "stream";
const app = express();

const messages = ['Hey!', 'How are you?', 'Thanks suXin for help :birb:'];

app.get('/', (req, res) => {
console.log("New request");
var i = 0;
res.setHeader('Content-Type', 'text/plain');

const readable = new Readable();
readable._read = () => {}; // Required for a readable stream

const interval = setInterval(() => {
readable.push(`${messages[i]}\n`);
console.log(messages[i]);
i++;

if (i >= messages.length) {
clearInterval(interval);
readable.push(null);
}
}, 1000);

readable.pipe(res);
});

app.get("/health", (req, res) => {
res.status(200).send({
status: "OK"
});
})

app.listen(3000, () => {
console.log("Listening on port 3000");
});
How would I fix it?
14 replies
RRailway
Created by lennard. on 12/19/2022 in #✋|help
NPM packages not installing
Hello everyone! This is my first time deploying w/ railway.app and I can't get my NPM packages running. Here is my structure:
20 replies