c3d2-wiki/Miniwebserver.mw

44 lines
760 B
Plaintext
Raw Permalink Normal View History

2013-11-19 02:40:06 +01:00
== Python2 ==
2013-10-30 23:24:16 +01:00
<source lang="bash">
python -m SimpleHTTPServer 8888
2007-11-14 21:47:37 +01:00
</source>
2013-11-19 02:40:06 +01:00
== Python3 ==
2013-10-30 23:24:16 +01:00
<source lang="bash">
python3 -m http.server 8888
2007-11-14 21:26:39 +01:00
</source>
2013-11-19 02:40:06 +01:00
=== guru version ===
<source lang="bash">
twistd -n web --path $path --port $port
</source>
2013-11-19 02:40:06 +01:00
== Ruby ==
=== äđëqüäŧë ===
2007-11-14 00:19:31 +01:00
<source lang="ruby">
#!/usr/local/bin/ruby
require 'webrick'
include WEBrick
if ARGV.size != 2
puts "Usage: #{$0} <port> <dir>"
exit
end
s = HTTPServer.new(
:Port => ARGV[0].to_i,
:DocumentRoot => ARGV[1]
)
trap("INT"){ s.shutdown }
s.start
</source>
2013-11-19 02:40:06 +01:00
== gürü ==
2007-11-16 00:03:33 +01:00
<source lang="bash">
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8080,:DocumentRoot=>"/tmp").start'
</source>
{{Rübÿ Spëëd Mëtäl Cödïng}}
2013-11-19 02:40:06 +01:00
[[Category:Python]]
[[Category:Ruby]]