Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add basic web development server.

  • Loading branch information...
commit 898149d6cb9204dbbea4fc6ee292bba9adfbd554 1 parent 9b16db2
@SaberUK authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 bin/serve
View
17 bin/serve
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+# ==============================================================================
+# SaberUK's Dot Files <https://github.com/saberuk/dotfiles/>
+# ==============================================================================
+# Copyright (C) 2012 Peter "SaberUK" Powell <petpow@saberuk.com>
+# ==============================================================================
+require 'webrick'
+if ARGV.size < 1
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <dir>"
+ exit 1
+else
+ server = WEBrick::HTTPServer.new(Address: '0.0.0.0', Port: 9999, DocumentRoot: ARGV[0])
+ trap 'INT' do
+ server.shutdown
+ end
+ server.start
+end
Please sign in to comment.
Something went wrong with that request. Please try again.