groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <>
Subject Re: SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? )
Date Wed, 14 Dec 2016 23:41:43 GMT
     Actually you can think of -lh as an extention of existing -l, the latter launches socket
server and the former launches http server. We should have hooked http server function to
the existing socket server, but maintaining a http server need much time and HR, so I implement
it based on JDK built-in http server(NO 3rd party library) and use a separate option -lh.
     It is a practical function for many developers(especially for web app developers).


在 2016年12月15日 上午1:48,"Marcin Erdmann [via Groovy]" <>写道:
-1 from me as well, fells more like a lib feature than a language feature. I agree with other
folks that it is bloating the language for quite a narrow usecase.

On Wed, 14 Dec 2016 at 12:39, Sergei Egorov <[hidden email]</user/SendEmail.jtp?type=node&node=5737243&i=0>>
Hi Daniel,

To be honest, I don't like it, -1 from me.

Why? Because we already put more and more stuff into the groovy itself, but, i.e. in a case
of python, SimpleHTTPServer it's just a module after all.

I would rather see something like:

groovy -m com.sparkjava:spark-groovy -c "serve(port: 8080, path: 'd:\\temp')"

On Wed, Dec 14, 2016 at 2:29 PM Daniel Sun <[hidden email]</user/SendEmail.jtp?type=node&node=5737243&i=1>>
Hi all,

        SimpleHTTPServer has been implemented(, it

supports serving files not only under directory but also in the zip file.

Here is the usage: "-lh <httpServerPort>         listen on a port and

provide http service", e.g.

*serve files under current directory*: groovy -lh 8000

*serve files under a specified directory*: groovy -lh 8000 d:\temp

*serve files in a zip file(we can view javadoc and groovydoc in the zip

files inspried by GroovyHelp)*: groovy -lh 8000 d:\

         In addition, we can change the context root(/helloworld, default

context root is /) via passing complete arguments: groovy -lh 8000 d:\temp

helloworld,  its usage is: groovy -lh <httpServerPort> <base directory>

[context root]

         After the SimpleHTTPServer launched, we can access files via

visiting http://localhost:<httpServerPort>/<context root>/<path relative to

the base directory>

         Any thoughts?




View this message in context:

Sent from the Groovy Dev mailing list archive at

If you reply to this email, your message will be added to the discussion below:
To unsubscribe from SimpleHTTPServer for Groovy 3( Maybe Groovy 2.5.0? ), click here<>.

View this message in context:
Sent from the Groovy Dev mailing list archive at
View raw message