Skip to content

Commit d592598

Browse files
committed
Add script/server and other needed changes
1 parent 0cca002 commit d592598

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

Procfile.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: ./bin/rails server -p 5000

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Alternatively, you can get the book content from a repository on your computer b
5353

5454
Now you can run the Rails site to take a look.
5555

56-
$ rails server
56+
$ ./script/server
5757

58-
The site should be running on http://localhost:3000
58+
The site should be running on http://localhost:5000
5959

6060

6161
## Testing
@@ -66,7 +66,7 @@ To run the tests for this project, run:
6666

6767
To run the website for testing purposes, run:
6868

69-
$ rails server
69+
$ ./script/server
7070

7171
## Contributing
7272

script/server

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# script/server: Launch the application and any extra required processes
4+
# locally.
5+
6+
set -e
7+
8+
cd "$(dirname "$0")/.."
9+
10+
# ensure everything in the app is up to date.
11+
script/update
12+
13+
test -z "$RACK_ENV" &&
14+
RACK_ENV='development'
15+
16+
# boot the app and any other necessary processes.
17+
foreman start -f Procfile.dev

script/update

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# script/update: Update application to run for its current checkout.
4+
5+
set -e
6+
7+
cd "$(dirname "$0")/.."
8+
9+
script/bootstrap
10+
11+
echo "==> Updating db..."
12+
# run all database migrations to ensure everything is up to date.
13+
bin/rake db:migrate

0 commit comments

Comments
 (0)