Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:46
    Qws commented #3754
  • 13:46
    Qws commented #3754
  • 13:14
    bartlomieju edited #3760
  • 13:14
    bartlomieju edited #3760
  • 12:05
    bartlomieju synchronize #3760
  • 11:54
    bartlomieju synchronize #3760
  • 11:10
    claassistantio commented #3761
  • 11:09
    sfabriece opened #3761
  • 10:59
    bartlomieju opened #3760
  • 10:50
    kitsonk commented #1421
  • 10:48
    kitsonk synchronize #3755
  • 10:40
    kt3k synchronize #3757
  • 10:23
    brandonkal commented #3756
  • 09:59
    kt3k synchronize #3757
  • 09:53
    Qix- commented #1421
  • 09:42
    kt3k synchronize #3757
  • 09:30
    bartlomieju edited #3759
  • 09:16
    bartlomieju closed #3749
  • 09:16
    bartlomieju commented #3749
  • 09:13
    bartlomieju edited #3759
Rouan van der Ende
@rvdende
I've been clicking through https://deno.land/x/ modules trying to find something that links to rust code so I can see how others structure their op function calls but I can't seem to find any, now before I write a scraper does anyone know of a deno/rust module I can look at? I've seen the https://github.com/denoland/deno/tree/master/test_plugin but looking for more examples
Bartek Iwańczuk
@bartlomieju
@rvdende I don't think there's many more native plugins
Rouan van der Ende
@rvdende
as in none?
Bartek Iwańczuk
@bartlomieju
that said, here's an example (https://github.com/denoland/deno/blob/master/cli/build.rs) of using Isolate and ops during build time of other crate
Rouan van der Ende
@rvdende
thanks.. looks like I'll have to dig around a bit more
Bartek Iwańczuk
@bartlomieju
@rvdende also that's pretty relevant, keep in mind that currently we don't have any "dispatch" exported (denoland/deno#3692) so that means you'll have to do heavy lifting yourself (or just copy-paste cli/ops/dispatch_json.rs file)
Rouan van der Ende
@rvdende
Okay I think I will avoid rust plugin and just do full deno implementation
Nikos
@QuantumInformation

just tried this, "start": "deno run server.ts --allow-net --allow-env" but it says

run again with the --allow-env flag

Bartek Iwańczuk
@bartlomieju
@QuantumInformation try: deno run --allow-net --allow-env server.ts
Nikos
@QuantumInformation
nice thx
btw this should output local host so i can click on the url
image.png
Bartek Iwańczuk
@bartlomieju
feel free to open a PR in std/http/server.ts - seems useful
Nikos
@QuantumInformation
ok
btw how do I get rid of all the red lines
image.png
in webstorm
@bartlomieju btw, would you like to talk deno on my radio show?
Bartek Iwańczuk
@bartlomieju
@QuantumInformation that's a hard question - you'd need to manually add Deno type declarations to WebStorm (you can output declaration with deno types > lib.deno_runtime.d.ts). There's VSCode plugin that can do that automatically https://marketplace.visualstudio.com/items?itemName=justjavac.vscode-deno
Nikos
@QuantumInformation
many thx
Nikos
@QuantumInformation
so now that we dont have npm scripts are you guys using make files?
ie
image.png
Rouan van der Ende
@rvdende
@QuantumInformation @bartlomieju i'd listen to that
Nikos
@QuantumInformation
)
Nikos
@QuantumInformation
any deno eq replacement for http-server?
asked cause http-server started to annoy me
image.png
just want to serve up this index file
Bartek Iwańczuk
@bartlomieju
@QuantumInformation you might want to look at https://github.com/denoland/deno/blob/master/std/http/file_server.ts
Nikos
@QuantumInformation

thx

these two files are in the same dir: have I got this right?

image.png
image.png
Bartek Iwańczuk
@bartlomieju
yeah
Nikos
@QuantumInformation
i get i need to add that path thing
Bartek Iwańczuk
@bartlomieju
also check out auto-generated docs at: https://deno.land/x/std/http/file_server.ts
deno install is one of command that installs the script
so installing multiple times will reload the code each time
Nikos
@QuantumInformation
Bartek Iwańczuk
@bartlomieju
yikes, looks like no docstring there, try https://deno.land/x/std/http/server.ts?doc
Nikos
@QuantumInformation
image.png
file server echos raw text
Eric Crooks
@crookse
the response's content type header probably isn't set to text/html
response.headers.set("Content-Type", "text/html"). although file_server.ts (if you're using that) sets the content type header to text/plain on line 109
Nikos
@QuantumInformation
@crookse do you have an example ts file for that
or is there another plugin i can just use on the command line
Eric Crooks
@crookse
in your case of using file_server, i would copy file_server.ts in your project's directory and change line 109 to use text/html. then instead of running https://deno.land/x/std/http/file_server.ts, you would run your local, modified file_server.ts file
Thomas Rasmussen
@Tallestthomas
Hm, it appears the Crypto isn't fully implemented yet, it only exposes the getRandomValues function, so I don't think theres a clear way to do hashing yet
Nikos
@QuantumInformation
ah great thx