4 ms·
Weblite-Go – A simple webserver written in Go
- thinkingkong 9y agoFor anyone that doesn't know, python has a handy one-liner on the command line. python -m SimpleHTTPServer Works like a charm.
- mastermindxs 9y agoAnd more https://gist.github.com/willurd/5720255 https://gist.github.com/willurd/5720255
- agnivade 9y agoI have had problems with it streaming medium sized video files. Node's http-server was able to serve it.
- phrasz 9y agoI shared the link, since it was hosting webm based videos like a champ. I figured Fro wouldn't mind :) The old solution we had been trying was weblite, and that needs all the user-content data to be manually added to weblite. Now I get to be lazy, cross platform, and have stand alone binaries ;)
- jug 9y agoAlso while on this topic of starting up quick, simple servers for whatever reason like testing etc. I've also had success with Web Server for Chrome which supposedly even works fine on Chromebooks. https://github.com/kzahel/web-server-chrome https://github.com/kzahel/web-server-chrome
- kevrone 9y agoAny obvious reason why this is significantly different than the built-in http.FileServer? https://golang.org/pkg/net/http/#FileServer https://golang.org/pkg/net/http/#FileServer
- phrasz 9y agoIt's not. It's extended from that. However, that code won't deal with other things like changing the port, having a built-in index, or having the server run for a discrete amount of files to serve. Also, go is no different than Java: https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver.... The server just allows it to be stand alone as an application.