luminus | documentation site for Luminus framework | Application Framework library
kandi X-RAY | luminus Summary
kandi X-RAY | luminus Summary
sources of the documentation site for the Luminus framework. Copyright 2015 Dmitri Sotnikov. Distributed under the MIT License.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of luminus
luminus Key Features
luminus Examples and Code Snippets
Community Discussions
Trending Discussions on luminus
QUESTION
This question is off the back of a previous question I asked here a few days ago. One of the comments was that I should dispense with the Ring middleware for extracting query parameters and write my own. One alternative that I thought I'd play with was harnessing the existing one to get what I want and I've been doing some digging into the Ring source code. It does almost exactly what I want. If I write out how I understand it works:
- A middleware has the function wrap-params which calls params-request
- params-request adds a
params
map to therequest
map, callsassoc-query-params
- assoc-query-params eventually calls ring.util.codec/form-decode on the incoming query string to turn it into a map
- form-decode uses assoc-conj to merge values into an existing map via reduce
- assoc-conj's docstring says
Associate a key with a value in a map. If the key already exists in the map, a vector of values is associated with the key.
This last function is the one that is problematic in my previous question (TL;DR: I want the map's values to be consistent in class of either a string or a vector). With my object orientated hat on I would have easily solved this by subclassing and overriding the method that I need the behaviour changed. However for Clojure I cannot see how to just replace the one function without having to alter everything up the stack. Is this possible and is it easy, or should I be doing this another way? If it comes to it I could copy the entire middleware library and the codec one, but it seems a bit heavyweight to me.
...ANSWER
Answered 2021-Jun-09 at 09:22I disagree with the advice to not use Ring's param middleware. It gives you perfect information about the incoming parameters, so you if you don't like the default behavior of string-or-list, you can change the parameters however you want.
There are numerous ways to do this, but one obvious approach would be to write your own middleware, and insert it in between Ring's param middleware and your handlers.
QUESTION
Trying to create the simple example app from Leiningen with Luminus template and H2 db. Nothing fancy, I literally see tons of examples doing this but always get No suitable driver
.
ANSWER
Answered 2021-Mar-21 at 18:07I just ran lein new luminus guestbook +h2
then cd guestbook
and lein run
and (after downloading a lot of libraries) it starts the web server as expected and browsing http://127.0.0.1:3000
displays the Luminus web app.
Can you share the exact steps you took that give you that error?
QUESTION
Given a simple webapplication like
...ANSWER
Answered 2020-May-20 at 19:20You can use :adapter
key.
Finally I tested and no, the tag :adapter
allows to pass the options for ring.jetty.adapter only.
After analyse the source code, there is no possibility to switch the adapter.
Here an reponse from the plugin author to a similar query: https://stackoverflow.com/a/24307363/5773724
QUESTION
I write Clojure using the VS Code Calva extension, which uses clj-kondo to perform static analysis of my code.
I'm using HugSQL to create Clojure functions from SQL queries and statements.
I'm aware that I could handle the database connection and the HugSQL integration with a library like conman, infact I used it in the past and I like it, but this time I wanted to keep things vanilla and talk to HugSQL myself.
HugSQL's def-db-fns
macro takes a SQL file and creates Clojure functions based on the SQL queries and statements contained in that file.
My code below works, but clj-kondo complains that seed-mytable!
is an unresolved symbol.
ANSWER
Answered 2020-May-11 at 10:58From the clj-kondo documentation:
Sometimes vars are introduced by executing macros, e.g. when using HugSQL's def-db-fns
. You can suppress warnings about these vars by using declare
. Example:
QUESTION
Edit (fixed)...
If you are following the Luminus guestbook tutorial or adapting parts of it, you may come across an error like Parameter Mismatch: :name parameter data not found.
, and it may not go away, regardless of what parameters you use. You may find that you are attempting to call a function that does not exist, and that Conman/HugSQL doesn't know what to do with it.
The answer to my question is in the section below:
The relevant section of code is in myapp.routes.home/create-user!
ANSWER
Answered 2020-Mar-22 at 22:36In my call to db/create-user!, within myapp.routes.home/create-user!, I had inadvertently passed an extra argument. This was blowing up when Conman tried to do something with it. Code and explanation in the original post. Short answer: I counted my parentheses incorrectly. :/
QUESTION
I am following guestbook example from the book Web Development With Clojure 3rd edition. I am struggling with including ClojureScript namespace into HTML document. Everything is working fine with example where I have one core.cljs. With that file, only I have to do is to include this piece of code into home.html document:
...ANSWER
Answered 2020-Mar-22 at 03:44In general, a Luminus project with ClojureScript support will compile all ClojureScript code into a single app.js
file, as in this block of the project.clj
file (from a project I just created with lein new luminus guestbook +h2 +immutant +cljs
, where the +cljs
is the important bit):
QUESTION
I'm creating a web app with Clojure and Luminus, but when I create a migration file with all the tables I need, it will only create the first. This is my user-table.up.sql
file:
ANSWER
Answered 2018-Apr-16 at 11:26As you are using Luminus, you are probably using Migratus. If you want to execute multiple statements in one sql file, read this:
QUESTION
As of right now (2018) what is the http/tcp server used when you set up a luminus template project with its default setting?
I'm reading that luminus uses immutant, however, immutant is a collection of other stuff. and I've also read that the underlying server used in immutant is undertow.
Am I correct in assuming that the default server is undertow? If so, how does the default set up perform with respect to non-blocking IO? Does this server afford a non-blocking event loop architecture like nginx/nodejs?
...ANSWER
Answered 2018-May-16 at 11:04It looks like it uses immutant by default, but you can choose alternative servers.
QUESTION
I am writing a web application with the backend in Clojure and the frontend in Clojurescript with React and Reagent. I am trying to host it on Heroku.
When I run lein ubjerar
locally, it builds fine and the app works.
However, when I try to deploy the app to Heroku via git push heroku master
, I always end up with an error like this:
ANSWER
Answered 2019-Jun-21 at 04:30Is your project based on some framework (like Luminus)? Can you post your project.clj
file? That info would help others to understand what is going on.
Depending on your project configuration, running lein uberjar
could be doing different things. It's most common to have a Clojure backend where the uberjar
task does the compilation of Clojure and Java into bytecode and packaging the results into a JAR file. It's also possible that you have some alias that adds the steps to download dependencies from NPM and compilation of ClojureScript into assets that also are packaged as part of the JAR, but it's hard to tell without looking at the project.clj
file.
QUESTION
I am trying to connect to Repl in Clojure project in Light Table. I went to connections, chose project.clj I wanted to connect to but unfortunately without success. I created project with "lein new app my-app". Before this, I had tried to connect with some another project that I had created with Luminus template and it was successfully. But when I made this simple app with "lein new app my-app" I cant connect. I got the following error:
...ANSWER
Answered 2019-Apr-13 at 05:05Hmmm. The problem here is, LT doesn't support a Clojure project running Clojure >1.8.0. Yes, LT needs to update to support new Clojure/Script versions. There are WIP patches to help make this possible. For now, sadly, you'll have to drop down to older releases of Clojure.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install luminus
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page