Miniwebserver: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Astro (Diskussion | Beiträge) (This page must use the Rübÿ Spëëd Mëtäl Cödïng template!!!111) |
Mic92 (Diskussion | Beiträge) (Python webserver vereinfacht.) |
||
Zeile 1: | Zeile 1: | ||
[[Category:Ruby]] [[Category:Python]] | [[Category:Ruby]] [[Category:Python]] | ||
= | =Python2= | ||
<source lang="bash"> | |||
<source lang=" | python -m SimpleHTTPServer 8888 | ||
</source> | </source> | ||
= | =Python3= | ||
<source lang=" | <source lang="bash"> | ||
python3 -m http.server 8888 | |||
</source> | </source> | ||
==guru version== | ==guru version== |
Version vom 30. Oktober 2013, 22:24 Uhr
Python2
python -m SimpleHTTPServer 8888
Python3
python3 -m http.server 8888
guru version
twistd -n web --path $path --port $port
Ruby
äđëqüäŧë
#!/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
gürü
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8080,:DocumentRoot=>"/tmp").start'
Rübÿ Spëëd Mëtäl Cödïng
Projects: CacaANSICam | Date Determinator | DVB-Scraping | Filmnächte-Scraping | GeeKal | Gruntmaster | Harvester | Hirn | Irb | Jargon-File | Ruby-MediaWiki | Miniwebserver | Momomoto | Pentabarf | Podcast-fetching | Ruby | Ruby-Geekend | Ruby und Ruby on Rails | Sedusa | VDS-Badges | Xmotoctl | Youtube-Scraping