【问题标题】:Running compojure with ring from Intellij IDEA REPL使用 Intellij IDEA REPL 的环运行 compojure
【发布时间】:2019-08-27 01:50:21
【问题描述】:

我一直在努力从 IntelliJ Idea 启动基于组合的应用程序,我遵循了这个 stackoverflow 答案中提供的说明

How to use compojure from Intellij

但是,当我尝试加载我的处理程序时,我得到*ClassNotFoundException*

(use hello-compojure.handler)
Syntax error (ClassNotFoundException) compiling at (form-init4214569335684752102.clj:1:1).
hello_compojure.handler

下面是处理程序代码

(ns hello-compojure.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defroutes app-routes
  (GET "/" [] "Hello World")
  (GET "/hello" []  "hello second world")
  (route/not-found "Not Found"))

(def app
  (wrap-defaults app-routes site-defaults))

有这种设置经验的人吗?

【问题讨论】:

    标签: intellij-idea clojure leiningen


    【解决方案1】:

    原来我在require 声明中错过了'

    Connecting to local nREPL server...
    Clojure 1.10.0
    nREPL server started on port 33629 on host 127.0.0.1 - nrepl://127.0.0.1:33629
    (require 'ring.adapter.jetty)
    => nil
    (require 'hecompojure.handler)
    => nil
    (ring.adapter.jetty/run-jetty hecompojure.handler/app {:port 3004})
    2019-04-05 14:05:34.766:INFO:oejs.Server:jetty-7.6.13.v20130916
    2019-04-05 14:05:34.800:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3004
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-21
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 2013-05-09
      • 1970-01-01
      • 1970-01-01
      • 2015-01-18
      相关资源
      最近更新 更多