Comments (6)
Sorry for delay. I am not sure what the issue is? CLOG generally deals with all routing beyond routes static-files/ Is there something you are looking to accomplish?
from clog.
Thanks for the reply! What I want to accomplish is being able to route things in a way much like easy-routes, so that I could define a route like /foo/:x/:y
and get whatever is :x
and :y
was, and it looked like using the "default" path was the entry point to do that.
But I wasn't able to get my default handler to do its thing, so I looked to the tutorial. What the on-default
handler looks like it does if none of the other paths match is: it'll run on-tutorial11
if the pathname is "/tutorial/tut-11.html", or display "No dice!" if it isn't. It works as expected when I go to "/tutorial/tut-11.html", but I did not get "No dice!" when I tried something like "/not-a-real-path", instead I just got "Not found".
Apologies if I completely misunderstood what "default" is suppose to do since its documentation mentions using boot-file.
from clog.
Routing currently in CLOG is based on what path you associate with you handler is SET-ON-NEW-WINDOW. If you set :PATH to "" than that handler is called if there is no other path to a handler is set. It is possible in that handler (the default handler) to do your own routing by using the functions in clog-location.lisp to look at the url and then just call the handler function you want with the body parameter.
from clog.
For some reason I think I overlooked your issue, and didn't fully understand it or your issue. My deepest apologies. My focus for next release is on "website" development were previously it was on the GUI side predominantly.
The current concept of a "default" route as in tutorial 12 is about a very different situation, and my documentation should have been more clear (fixing). It is the default in a case where a static html file includes the boot.js file but there is no route to specify which on-new-window-handler should handle on the lisp side that page, a far more limited situation.
What you are looking for and now I am working on is a way to handle default URL paths, a far more common website situation.
from clog.
I have pushed some updates to tutorial 12 and other files with better documentation. I am still working on default url paths.
from clog.
I have added "extended-routing" on initializing clog, when enabled allows routes to be extended such that /page1 would also handle /page1/any/thing/you/want
I may still in the future added something similar to easy-routes but the same thing is easily accomplished now by pattern matching on (path-name (location body)) in the handler.
from clog.
Related Issues (20)
- Lack-middleware-list not used
- Tutorial does not work after (ql:update-all-dists) HOT 12
- Multiple connections? HOT 3
- Path :default doesn't catch paths without valid files, even with :boot-file HOT 1
- custom slot fail HOT 3
- CLOG apps don't survive sleep / hybernation HOT 5
- Change links away from Reddit (or add direct links to the Google Docs) HOT 4
- Broken Pipe error HOT 1
- iPhone build HOT 2
- Javascript upload fails by unknown reason HOT 3
- Fix that (setf *print-case* :downcase) breaks the server and that no webpages are accessible HOT 12
- Form-dialog (clog-gui) has issues with values having single quotes HOT 2
- [Windows] open-window displays a failure even though window opens. HOT 1
- Clog gui-app runs fine from repl, but throws join-thread-error when trying to run from executable. HOT 2
- set-on-click is repeating data HOT 2
- Clog-Builder cannot open projects it creates. HOT 3
- Destroy is not applied to child elements HOT 1
- Is there a reason form-dialog does not allow textareas? HOT 3
- clog-db-table doesn't place td elements inside rows HOT 1
- Feature request: rulers in the builder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clog.