Open jman13378 opened 2 years ago
can you help with a screenshot i want to confim something
const express = require('express')
const app = express()
const fs = require('fs')
app.use(express.static('public'))
var lel = app.get('/', function (req, res) {
}).get('/site', function (req, res) {
fs.readFile('./public/site.html', async function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
return res.end();
});
}).get('/api/get/guilds', async function (req, res) {
res.send(`${await client.guilds.cache.size}`)
}).get('/api/get/members', async function (req, res) {
res.send(`${await client.users.cache.size}`)
}).get('/api/get', function (req, res) {
fs.readFile('./public/api/get/', async function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
return res.end();
});
}).listen(port,"0.0.0.0", ()=>{
console.log(`Listening port on ${lel.address().port}`)
});
sorry for asking is the ip a publicly accessible ip address?
or that of localhost
that was my pc's ipv4 but my public ip address does the same thing. My ipv4, localhost, and public address work on local devices
ok can you try using ngrok to expose the local port and lets see how that goes?
it works but i would rather use my ip
i guess the main issue is the ip adress.
i guess its not being exposed
It is also possible there is a firewall involved, either on the device itself or the network between the two machines. If you are able to at least get a reaponse on loopback (i.e. 127.0.0.1), then the issue is outside of the express.js framework and something network, machine, or node.js.
Hi @jman13378 I am certainly sorry you are having trouble. It is unfortunately we are not sure what the issue is exactly that you are experiencing and we are not also experiencing. That puts us in a hard place to help. If you believe this is an issue in Express.js, it may help if you can help provide pointers for where you are seeing the issue in our code and we can perhaps work towards what code changes we need to make, or you're always welcome to contribute such a change directly. Other than that, I'm not sure how else we can help.
It is also possible there is a firewall involved, either on the device itself or the network between the two machines. If you are able to at least get a reaponse on loopback (i.e. 127.0.0.1), then the issue is outside of the express.js framework and something network, machine, or node.js.
yea @dougwilson because ngrok also works according to him
Well, here is a test @jman13378 : see if the following code has the same issue or not. This will narrow down for if the Express.js project can assist or not:
const http = require('http')
const app = http.createServer((req, res) => res.end('Hello, world!'))
app.listen(3000, "0.0.0.0")
const http = require('http') const app = http.createServer((req, res) => res.end('Hello, world!')) app.listen(3000, "0.0.0.0")
not that
its most likely an ISP issue or Firewall
were you able to solve the issue ? or is it still not working ?
Looking on my side like other people said it is most likely some kind of firewall / blocking the request
I will try in my pi but other than that I have not fixed it
so im trying to create an express server but i get ERR_EMPTY_RESPONSE(from a VPN) on other devices and my friends got ERR_CONNECTION_TIMED_OUT
how can i fix this