Skip to content

Commit efdba57

Browse files
authored
Merge pull request #158 from st0012/make-it-easier-to-preview-changes
Add `bin/server` for previewing `public` directory locally
2 parents 01678aa + dc0e64d commit efdba57

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ gem 'capistrano-bundler'
77
# ed25519
88
gem 'ed25519'
99
gem 'bcrypt_pbkdf'
10+
11+
# For previewing public directory locally with `bin/server`
12+
gem 'webrick'

Gemfile.lock

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ GEM
3434
net-ssh (>= 2.8.0)
3535
ostruct
3636
stringio (3.1.2)
37+
webrick (1.8.2)
3738

3839
PLATFORMS
3940
ruby
@@ -44,3 +45,7 @@ DEPENDENCIES
4445
capistrano-bundler
4546
ed25519
4647
rdoc (>= 6.0.0.beta2)
48+
webrick
49+
50+
BUNDLED WITH
51+
2.5.17

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
* https://github.com/ruby/rurema-search
3232
* https://github.com/rurema/generated-documents
3333

34+
## Previewing `public` directory locally
35+
36+
1. Install dependencies: `bundle install`
37+
2. Run:
38+
```
39+
bin/server
40+
```
41+
3. Open http://localhost:8000/
42+
3443
## Production Environment
3544

3645
### Capstrano

bin/server

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
3+
require "webrick"
4+
5+
server = WEBrick::HTTPServer.new(Port: 8000, DocumentRoot: 'public')
6+
server.start

0 commit comments

Comments
 (0)