갈루아의 반서재

Luminus 를 이용한 Clojure 방명록 만들기 (3)


Running the Application

다음과 같이 개발모드에서 어플리케이션을 구동할 수 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
~/guestbook$ lein run
2018-08-21 10:14:21,661 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
2018-08-21 10:14:23,384 [main] INFO  guestbook.env -
-=[guestbook started successfully using the development profile]=-
2018-08-21 10:14:23,578 [main] INFO  luminus.http-server - starting HTTP server on port 3000
2018-08-21 10:14:23,653 [main] DEBUG io.undertow - starting undertow server io.undertow.Undertow@7d4c8606
2018-08-21 10:14:23,671 [main] INFO  org.xnio - XNIO version 3.3.6.Final
2018-08-21 10:14:23,959 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 3000
2018-08-21 10:14:24,028 [main] INFO  org.projectodd.wunderboss.web.Web - Registered web context /
2018-08-21 10:14:24,029 [main] INFO  guestbook.nrepl - starting nREPL server on port 7000
2018-08-21 10:14:24,062 [main] INFO  guestbook.core - #'guestbook.db.core/*db* started
2018-08-21 10:14:24,062 [main] INFO  guestbook.core - #'guestbook.handler/init-app started
2018-08-21 10:14:24,062 [main] INFO  guestbook.core - #'guestbook.handler/app started
2018-08-21 10:14:24,063 [main] INFO  guestbook.core - #'guestbook.core/http-server started
2018-08-21 10:14:24,063 [main] INFO  guestbook.core - #'guestbook.core/repl-server started
 
 
cs

일단 서버가 구동되면, http://localhost:3000 로 앱이 작동하는 것을 확인할 수 있다. 

3000번 이외의 포트에서도 구동이 가능하다. 다음과 같이 매개변수로 포트 번호를 넘기거나, PORT 환경변수를 설정하면 된다. 

1
~/guestbook$ lein run -p 8000
cs

그리고, 또 다른 방법으로 REPL 을 이용하여 구동시킬 수도 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
~/guestbook$ lein repl
2018-08-21 10:22:29,838 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
nREPL server started on port 38685 on host 127.0.0.1 - nrepl://127.0.0.1:38685
REPL-0.3.7, nREPL 0.2.12
Clojure 1.9.0
OpenJDK 64-Bit Server VM 10.0.1+10-Ubuntu-3ubuntu1
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1*2*3, an exception in *e
 
user=> (start)
2018-08-21 10:22:44,499 [nREPL-worker-1] INFO  guestbook.env -
-=[guestbook started successfully using the development profile]=-
2018-08-21 10:22:44,731 [nREPL-worker-1] INFO  luminus.http-server - starting HTTP server on port 3000
2018-08-21 10:22:44,824 [nREPL-worker-1] DEBUG io.undertow - starting undertow server io.undertow.Undertow@1c70646
2018-08-21 10:22:44,843 [nREPL-worker-1] INFO  org.xnio - XNIO version 3.3.6.Final
2018-08-21 10:22:45,134 [nREPL-worker-1] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 3000
2018-08-21 10:22:45,206 [nREPL-worker-1] INFO  org.projectodd.wunderboss.web.Web - Registered web context /
{:started ["#'guestbook.config/env" "#'guestbook.db.core/*db*" "#'guestbook.handler/init-app" "#'guestbook.handler/app" "#'guestbook.core/http-server"]}
user=>
 
cs