Example project for using Compojure-api.
lein ring server
lein do clean, ring uberjar
java -jar target/examples.jar
lein ring uberwar
Copyright © 2014-2015 Metosin Oy
Distributed under the Eclipse Public License, the same as Clojure.
Compojure API example
Example project for using Compojure-api.
lein ring server
lein do clean, ring uberjar
java -jar target/examples.jar
lein ring uberwar
Copyright © 2014-2015 Metosin Oy
Distributed under the Eclipse Public License, the same as Clojure.
Hi folks,
Just getting started with compojure-api; looks very good. I managed to get your example running on Google App Engine - well, at least on the dev server. It's surprisingly simple, and with a minor (but nasty) hack you get something like a REPL. If you want to add a GAE sample here let me know.
-Gregg
Somehow lein ring uberwar tries to use old version of clj-time (pre 0.6.0). Adding [clj-time "0.6.0"] to dependencies fixes this.
% lein ring uberwar
Exception in thread "main" java.lang.RuntimeException: No such var: tf/parse-local-date, compiling:(ring/swagger/coerce.clj:14:25)
at clojure.lang.Compiler.analyze(Compiler.java:6380)
at clojure.lang.Compiler.analyze(Compiler.java:6322)
I have created one project lein new compojure-api my-app
command and ran the project with lein run
command
I am getting this error.
Exception in thread "main" java.lang.AbstractMethodError: Method compojure/api/routes/Route.invoke()Ljava/lang/Object; is abstract, compiling:(/private/var/folders/sc/_5vqrzqd6957db1699lb0lm00000gq/T/form-init5955368636245682796.clj:1:125)
After #1 is fixed (by adding clj-time 0.6.0 to deps), lein ring uberwar still fails. Due to some macro expansion problems?
$ lein clean ; lein ring uberwar
Exception in thread "main" java.lang.IllegalArgumentException: No matching clause: class compojure.api.swagger.CompojureRoutes, compiling:(samlink_jboss_monitor/handler.clj:15:3)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6567)
at clojure.lang.Compiler.analyze(Compiler.java:6361)
at clojure.lang.Compiler.analyze(Compiler.java:6322)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
...
Caused by: java.lang.IllegalArgumentException: No matching clause: class compojure.api.swagger.CompojureRoutes
at compojure.api.swagger$create_paths.invoke(swagger.clj:81)
at compojure.api.swagger$extract_routes.invoke(swagger.clj:120)
at compojure.api.swagger$swagger_info.invoke(swagger.clj:128)
at compojure.api.swagger$swaggered.doInvoke(swagger.clj:169)
lein ring uberwar
sudo cp target/examples.jar /var/lib/tomcat/webapps/examples.war
http://localhost:18080/examples/api/pizzas
=> works as expectedhttp://localhost:18080/examples/
=> redirects to http://localhost:18080/index.html
. Should redirect to http://localhost:18080/examples/index.html
http://localhost:18080/examples/index.html
(this is the correct URL), there is error Can't read swagger JSON from http://localhost:18080/api/api-docs
When war is deployed as a root war (that is, contextPath is '/') everything works.
Some component (swagger-ui?) should include contextPath to generated URLs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.