Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_server.ts is not setting the correct content-type header when serving index.html #4056

Closed
agusbena opened this issue Feb 20, 2020 · 5 comments

Comments

@agusbena
Copy link

When file_server.ts is serving the index.html, the browser is not rendering the page because it is receiving text/plain header for the content-type.

@zhmushan
Copy link
Contributor

see #3423 (comment)
In fact, we should set the content-type according to extname, but this will cause inconvenience to browse .ts files. In previous versions, some files were downloaded directly instead of displaying the content on the browser, so this was temporarily set to plain.
IMO, we can browse files in a way similar to deno_website2

@agusbena
Copy link
Author

agusbena commented Feb 21, 2020

Thanks @zhmushan for the clarification!

So is there a basic webserver for Deno anywhere? like http_server from node? i google but didn't found anything.
If there isn't any yet, whould you agree if I upgrade file_server.ts to have a mode like Node's http_server or what you would do?
I do really want so bad to use Deno for the project i am doing, loving it very much so far.
Thank you very much!

@zhmushan
Copy link
Contributor

zhmushan commented Feb 21, 2020

Ideally, html files should be rendered instead of displaying the code directly.

But we will face this issue, if we use the http-server mode directly:
Most deno developers often need to browse typescript files, but .ts extname has been defined as a video file.

Because of the name of file_server, I prefer to use it as a file explorer on default mode, and the http-server mode can be enabled by configuration. And we still need to listen to other developers' suggestions.

@agusbena
Copy link
Author

Fair enough, I agree. So probably we could provide a dedicated web server script like Node's http_server?
Hopefully anybody that thought about it can leave their comments here.
Thank you!

@zhmushan
Copy link
Contributor

zhmushan commented Apr 1, 2020

@agusbena fixed in #4555
This issue should be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants