D
Deno

help

Cannot access web server from other network devices when compiled

DDNA5/25/2023
Hello. Im kinda new to deno and i just compiled my first bigger project with deno, but when the task is running, i can access the website directly from my pc, but not from my phone, which is in the same network. This is my code:
import {serve} from "https://deno.land/std@0.188.0/http/server.ts";
serve(handler, {port: Number(env.PORT), onListen: () => console.log(`Listening on http://localhost:${env.PORT}`)});
import {serve} from "https://deno.land/std@0.188.0/http/server.ts";
serve(handler, {port: Number(env.PORT), onListen: () => console.log(`Listening on http://localhost:${env.PORT}`)});
MMrKleeblatt5/25/2023
I guess if you ran the file directly through Deno without compilation it would work?
DDNA5/25/2023
Forgot to add that to my message, but yes Works wo/ any issues Without compilation (just deno run main.ts), it works completely fine
MMrKleeblatt5/25/2023
Which OS do u use?
DDNA5/25/2023
Windows 11 22H2 22621.1702 64bit
MMrKleeblatt5/25/2023
Works for me on Linux, maybe has something to do with the windows compile system...
DDNA7/25/2023
Is there an update to this?
Yybabts7/25/2023
Yes I believe you can choose for the server to listen on a specific host name, just use the host name 0.0.0.0 instead of the default 127.0.0.1. But I'd have to test it later and try and replicate your problem.

Looking for more? Join the community!

Recommended Posts
How to use chrome devtools / inspector with Deno?Hello all! I'd like to profile my game server written in Deno to identify the hot spots. I see thaClear local KV storeHow do I delete/clear the local database?Deno.Command not working for applicationHello. Im trying to start an application using Deno.Command, but it for some reason doesnt work. TheUint8Array or Float32ArrayIs there any significant difference between using a Float32Array and using a Uint8Array from the samSending proper Content-Type depending on file sentHello. Im new to Deno and TypeScript and i wanted to convert one of my older projects (NodeJs and JaReclaim an already registered module?Is it possible to reclaim an already registered third party module? For example if the module that iDeno.readDir on current script even if used like an http package.Hello !! I would like to do Deno.readDir and readFiles on files relative to the script that execute Top level awaits for `import()`How come to top-level awaits for `import()` not work? I found an issue on GitHub https://github.com/How to auto import on save?This doesn't work: { "deno.enable": true, "deno.lint": true, "deno.unstable": true, "editorRemove sink from streamIs it at all possible to "undo" adding a sink on a stream? I am trying to make it so that once the wHTTPS w/ client certificate – works in Node.js, not in DenoI am making an HTTPS call with a client certificate. It works great in Node.js, but when I try to doUsing encrypted private keys with DenoSo it seems to me that Deno doesn't provide any helpers for making HTTPS requests with encrypted priError when using readline.question()I get this error with the following code ```ts import process from 'node:process' import readline fjsx in denoHi, I have simple code that takes use of jsx. Based on deno docs, the jsx support should be ootb. IsExpress pt2 tutorial links to itselfAt the very start of the tutorial, it mentions that part 1 got up and running, but the link points tonboard is infiniteSeems like the onboarding process is broken and won't stop repeating itself You need to be a new memDeno mobile app?Anyone has made a mobile app using deno? I was planning to use Fresh and https://capacitorjs.com/ tWhat is the best way to count values with Deno.Kv?I want to show the total values in the database. It seems that the only way is with `kv.list()` and Does kv delete recursively?For example, if I have entries with keys: `['users', 1]`, `['users', 2]`, will `kv.delete(['users'])How do I send a simple text file to the printer?Hello. I am looking for an example of how to send a simple text file tot eh printer in Deno. Is this