Some more documentation
This commit is contained in:
parent
47356a82c8
commit
b0bf1a7cf4
5 changed files with 33 additions and 19 deletions
26
README.mkd
26
README.mkd
|
@ -5,15 +5,27 @@ dependencies. This takes a couple of seconds. After that, you can run the server
|
||||||
with `lein ring server-headless`. Now you can verify that nothing went wrong if
|
with `lein ring server-headless`. Now you can verify that nothing went wrong if
|
||||||
you open up the browser and visit http://0.0.0.0:3000/. There should be nothing
|
you open up the browser and visit http://0.0.0.0:3000/. There should be nothing
|
||||||
displayed because we doesn't fetch any data yet. If that works, we can proceed
|
displayed because we doesn't fetch any data yet. If that works, we can proceed
|
||||||
with the next step and import data.
|
with the next step and import data. You can leave the terminal open or start the
|
||||||
|
server just from the repl (preferred way).
|
||||||
|
|
||||||
Run a repl with `lein repl` in another terminal. Here we start the
|
Run a repl with `lein repl` in another terminal. Here we can start the
|
||||||
server, initiate the database and run the scrape process.
|
server, initiate the database and run the scrape process. First we start the server
|
||||||
|
(if not allready done)
|
||||||
|
|
||||||
(load-file "src/ldview/repl.clj")
|
(use 'ldview.repl)
|
||||||
(ldview.repl/start-server)
|
(ldview.repl/start-server)
|
||||||
|
|
||||||
(load-file "src/ldview/tasks/runner.clj)
|
Next, we set up the database and start the fetching process. This take a little
|
||||||
(in-ns 'ldview.tasks.runner)
|
time, so make yourself a cup of tea and be proud of yourself to get this far :)
|
||||||
(load-competition 27 "10 Seconds")
|
|
||||||
|
|
||||||
|
(use 'ldview.tasks.runner)
|
||||||
|
(ldview.tasks.runner/load-competition 27 "10 Seconds")
|
||||||
|
|
||||||
|
|
||||||
|
# Development
|
||||||
|
|
||||||
|
Sure, you want to make some changes on the code. It's clojure, it will be fun.
|
||||||
|
The server is allready online and serving html pages. If you making changes on
|
||||||
|
the code, the browser automatically reload the page after every code change. If
|
||||||
|
you want to reload the code in the repl after making some changes, use
|
||||||
|
`:reload-all` in addition to the `use` function.
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
(ns user)
|
|
||||||
|
|
||||||
;; Place some code for the repl here
|
|
15
project.clj
15
project.clj
|
@ -18,20 +18,17 @@
|
||||||
[enlive "1.1.5"]
|
[enlive "1.1.5"]
|
||||||
[me.raynes/fs "1.4.5"]]
|
[me.raynes/fs "1.4.5"]]
|
||||||
|
|
||||||
:source-paths ["dev"]
|
:main ldview.core
|
||||||
:plugins [[lein-ring "0.8.10"]]
|
:plugins [[lein-ring "0.8.10"]]
|
||||||
:ring {:handler ldview.handler/app
|
:ring {:handler ldview.handler/app
|
||||||
:init ldview.handler/init
|
:init ldview.handler/init
|
||||||
:destroy ldview.handler/destroy
|
:destroy ldview.handler/destroy
|
||||||
:open-browser? false
|
:open-browser? false}
|
||||||
:auto-reload? true
|
|
||||||
:auto-refresh? true}
|
|
||||||
:profiles {
|
:profiles {
|
||||||
:production {:ring {:open-browser? false
|
:production {:ring {:stacktraces? false}}
|
||||||
:stacktraces? false
|
:dev {:ring {:auto-reload? true
|
||||||
:auto-reload? false
|
:auto-refresh? true}
|
||||||
:auto-refresh? false}}
|
:dependencies [[ring-mock "0.1.5"]
|
||||||
:dev {:dependencies [[ring-mock "0.1.5"]
|
|
||||||
[ring/ring-devel "1.2.0"]]}}
|
[ring/ring-devel "1.2.0"]]}}
|
||||||
|
|
||||||
:url "http://ldview.arg-games.com/"
|
:url "http://ldview.arg-games.com/"
|
||||||
|
|
7
src/ldview/core.clj
Normal file
7
src/ldview/core.clj
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
(ns ldview.core
|
||||||
|
(:require [ldview.tasks.runner :as runner])
|
||||||
|
(:gen-class))
|
||||||
|
|
||||||
|
;; TODO: Grab the title from the page
|
||||||
|
(defn -main [competition-id]
|
||||||
|
(runner/load-competition competition-id "some title"))
|
|
@ -26,6 +26,7 @@
|
||||||
:init init
|
:init init
|
||||||
:destroy destroy
|
:destroy destroy
|
||||||
:auto-reload? true
|
:auto-reload? true
|
||||||
|
:auto-refresh? true
|
||||||
:open-browser? false
|
:open-browser? false
|
||||||
:join? false}))))
|
:join? false}))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue