reblocks icon indicating copy to clipboard operation
reblocks copied to clipboard

Make url Quickstart guide more user friendly

Open svetlyak40wt opened this issue 7 years ago • 4 comments

We need to update quickstart tutorial to make an app available on http://localhost:40000/ instead of http://localhost:40000/tasks, because some users may try to open the root of the server when they see such log message:

<INFO> [19:41:00] weblocks/server server.lisp (start-server) -
  Starting webserver on WEBLOCKS/SERVER::INTERFACE: "localhost"
  WEBLOCKS/SERVER::PORT: 40000 DEBUG: T
 #<SERVER port=40000 running>

and right now they will see an empty page saying:

File "/" was not found.

Alternatively, we may fix not the documentation but Weblocks, by making it to handle / route as special and showing a list of all of the available apps if none of them is bound to the / route. This will also help users who are making their apps themselves, not by following a quickstart guide.

svetlyak40wt avatar Feb 16 '19 09:02 svetlyak40wt

@vindarel what do you think about this?

svetlyak40wt avatar Feb 16 '19 09:02 svetlyak40wt

I agree there is something to fix regarding /, it is disturbing to not find anything at this url.

The quickstart does link to http://localhost:40000/tasks, but it doesn't explain where the "tasks" part come from (the defapp name ? But why ?). We have to enhance the log message at the very minimum.

Documenting how routing works will also help. If you could do that a bit that would help me too. Is it as simple as defining a main-widget ? In Ultralisp:

(defwidget main-widget
    ("/"
     (make-landing-widget))
  ("/login"
   (make-login-processor))
  ("/logout"
   (make-logout-processor))
  ("/github"
   (make-repositories-widget))
  ("/versions/\\d+"
   (make-version-widget))
  ("/projects/.*"
   (make-project-widget))
  (t
   (page-not-found)))

Doing something by default at / would be good indeed.

(ps: I didn't contribute in a long time but I'm working towards it ! (at least I'm lisping !))

vindarel avatar Feb 16 '19 22:02 vindarel

Great! I'll try to write documentation on routing until the end of February.

svetlyak40wt avatar Feb 17 '19 05:02 svetlyak40wt

maybe fixed. A default widget now shows the available apps at /, PR https://github.com/40ants/reblocks/commit/415926a07ecd1c514b64de5cf7a5f3285263c634

vindarel avatar Jan 05 '22 12:01 vindarel