Re:Major standard library changes in Go 1.20
by simiones on Tuesday January 17, 2023 @05:48AM
(#34411073)
Given that it was only added in Java 18 and it is a simple static file server (no way to run custom code when serving a URL), I don't think it's in any way widely used at the moment.
[ Parent
| on HN ]
Re:Major standard library changes in Go 1.20
by philosopher1234 on Tuesday January 17, 2023 @06:00AM
(#34411140)
From your description it sounds like it is a completely different beast from net/http
Re:Major standard library changes in Go 1.20
by simiones on Tuesday January 17, 2023 @07:35AM
(#34411718)
Yes, per the JEP that was linked, it is only intended as a toy server for quick example code, essentially:
> Provide a command-line tool to start a minimal web server that serves static files only. No CGI or servlet-like functionality is available. This tool will be useful for prototyping, ad-hoc coding, and testing purposes, particularly in educational contexts.
> It is not a goal to provide a feature-rich or commercial-grade server. Far better alternatives exist in the form of server frameworks (e.g., Jetty, Netty, and Grizzly) and production servers (e.g., Apache Tomcat, Apache httpd, and NGINX).
Re:Major standard library changes in Go 1.20
by dmux on Tuesday January 17, 2023 @11:22PM
(#34423406)
The specific web server in the JEP is relatively new, but there has been an http server implementaion since 1.6:
https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver...
Re:Major standard library changes in Go 1.20
by simiones on Wednesday January 18, 2023 @10:39AM
(#34427998)
Cool, I had no idea about this.
I see it's still available after the modularization effort, and it is:
https://docs.oracle.com/en/java/javase/18/docs/api/jdk.https...