Giter Club home page Giter Club logo

Comments (6)

rabbibotton avatar rabbibotton commented on May 20, 2024

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.

nnoodle avatar nnoodle commented on May 20, 2024

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.

rabbibotton avatar rabbibotton commented on May 20, 2024

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.

rabbibotton avatar rabbibotton commented on May 20, 2024

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.

rabbibotton avatar rabbibotton commented on May 20, 2024

I have pushed some updates to tutorial 12 and other files with better documentation. I am still working on default url paths.

from clog.

rabbibotton avatar rabbibotton commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.