blog-comments
A simple blog comments tool. Basic and friendly, based on Heroku's tutorial.
Usage
Running:
-
Set database environment variable:
$ export DATABASE_URL=postgresql://localhost:5432/shouter
-
Install dependencies:
$ lein deps
-
If the table isn't yet set up:
$ lein run -m blog-comments.models.migration
-
Start the REPL:
$ lein repl
-
Enter the following:
user=> (require 'blog-comments.core) nil user=> (use 'ring.util.serve) nil user=> (serve blog-comments.core/application) Started web server on port 3000 nil
When you want to reload your code:
user=> (require :reload-all 'blog-comments.core)
nil
Deployment
blog-comments is designed to run on Heroku. For the first deploy, do the following:
- Create the app on heroku:
$ heroku create --stack cedar
- Add a shared database to the app:
$ heroku addons:add shared-database
- Deploy the code:
$ git push heroku master
- Create the database table:
$ heroku run lein run -m blog-comments.models.migration
- Start the web process:
$ heroku scale web=1
- Admire in the browser:
$ heroku open
License
Copyright (C) 2011 Wilfred Hughes
Distributed under the Eclipse Public License, the same as Clojure.