File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Use `lein run client` to run the standalone game client.
1212## Game server
1313
1414### Running
15- Use ` lein run server [port] ` to run game server.
15+ Use ` lein ring server ` to run game server.
1616
1717### Protocol
1818Hyperspace protocol is very simple. All messages are transferred in the JSON format.
Original file line number Diff line number Diff line change 33 :dependencies [[com.googlecode.flyway/flyway-core " 2.3" ]
44 [com.h2database/h2 " 1.3.173" ]
55 [log4j/log4j " 1.2.17" ]
6+ [metosin/ring-swagger " 0.13.0" ]
7+ [metosin/compojure-api " 0.16.0" ]
8+ [metosin/ring-http-response " 0.5.0" ]
9+ [metosin/ring-swagger-ui " 2.0.17" ]
610 [midje " 1.5.0" ]
7- [org.clojure/clojure " 1.5.1 " ]
11+ [org.clojure/clojure " 1.6.0 " ]
812 [org.clojure/clojure-contrib " 1.2.0" ]
913 [org.clojure/data.json " 0.2.2" ]
1014 [org.clojure/tools.logging " 0.2.3" ]
1115 [org.clojars.rexim/jinput-platform-natives " 2.0.5" ]
1216 [org.ru.codingteam/lwjgl-platform-natives " 2.9.1" ]
1317 [org.lwjgl.lwjgl/lwjgl " 2.9.1" ]]
18+ :ring {:handler hyperspace.swagger.server/app}
19+ :uberjar-name " hyperspace-server.jar"
20+ :profiles {:uberjar {:resource-paths [" swagger-ui" ]
21+ :aot :all }
22+ :dev {:dependencies [[javax.servlet/servlet-api " 2.5" ]]
23+ :plugins [[lein-ring " 0.8.11" ]]}}
1424 :main hyperspace.main )
Original file line number Diff line number Diff line change 1+ (ns hyperspace.swagger.server
2+ (:require [compojure.api.sweet :refer :all ]
3+ [ring.util.http-response :refer :all ]
4+ [schema.core :as s]))
5+
6+ (s/defschema Total {:total Long})
7+
8+ (defapi app
9+ (swagger-ui )
10+ (swagger-docs
11+ :title " Hyperspace API"
12+ :description " Simple 2D game written in Clojure" )
13+
14+ (swaggered " user"
15+ :description " user manipulation"
16+ (POST* " /register" []
17+ :return String
18+ :query-params [login :- String
19+ password :- String]
20+ :summary " register user"
21+ (ok " Not implemented" ))))
You can’t perform that action at this time.
0 commit comments