denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.58k stars 5.33k forks source link

http/file_server broken #3465

Closed axetroy closed 4 years ago

axetroy commented 4 years ago

/cc @zhmushan

$ deno --version
deno 0.26.0
$ deno --allow-net https://deno.land/std/http/file_server.ts
HTTP server listening on http://0.0.0.0:4500/

access server via browser or curl and got 500 error

$ curl http://0.0.0.0:4500/
Internal server error
zhmushan commented 4 years ago

You should run:

deno --allow-net --allow-read https://deno.land/std/http/file_server.ts

This is because we need permission to read files.

axetroy commented 4 years ago

haa. I forgot it and Thx. 😢

kitsonk commented 4 years ago

Is it swallowing permission error though? It should log them to the console if it is trapping them.

zhmushan commented 4 years ago

@kitsonk I agree with you. @axetroy Could you reopen this issue?