* * *

Author Topic: Brook Framework Error  (Read 529 times)

woodengineer

  • New member
  • *
  • Posts: 20
Brook Framework Error
« on: February 13, 2017, 08:06:21 pm »
Hello,
I am running the unmodified simple static example from the Brook framework and get error for:
EBrookHTTP404.create(ARequest.PathInfo);
in line 726 of brookrouter.pas
I am using "http://localhost:8000/template.html" or "http://localhost:8000" as address.
I looked but could not find an answer. I am new to web development. Probably something very simple.
Thanks
Alex

Thaddy

  • Hero Member
  • *****
  • Posts: 3023
Re: Brook Framework Error
« Reply #1 on: February 13, 2017, 09:10:37 pm »
the file template.html can not be found in the first case. In the second case the -implicit- file index.html can not be found.
Create these files and put them in your server root directory and it should work.
Code: HTML5  [Select]
  1. Useless Empty file
  2. </body>
  3. </html>
  4.  

Save that as template.html and index.html.

It can also be the case that you forgot to set the root path altogether, if these files already exist in the example code.
« Last Edit: February 13, 2017, 09:16:15 pm by Thaddy »

woodengineer

  • New member
  • *
  • Posts: 20
Re: Brook Framework Error
« Reply #2 on: February 13, 2017, 09:33:52 pm »
Thanks for the reply Thaddy,
The file template.html exist. I did also copy template.html to index.html.
This example uses the builtin server. I assume that the root directory is the application directory. The full path to the example is:
"C:\lazarus\components\brookframework-3.0.0\demos\simple\static\"
Not sure how to set the root path?
Thanks!
Alex

Leledumbo

  • Hero Member
  • *****
  • Posts: 7508
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Brook Framework Error
« Reply #3 on: February 14, 2017, 04:53:41 am »
Look at unit1.pas and see how TIndex is registered, that's the URI you must use instead of referring to the filename or empty URI, obviously won't work.

woodengineer

  • New member
  • *
  • Posts: 20
Re: Brook Framework Error
« Reply #4 on: February 14, 2017, 02:19:05 pm »
Thanks Leledumbo!
It seems that there is something not working correct with the builtin server (probably a setting on my end). I get the default page displayed but the the css and js files are not used and the click event from the js file is not working. When I run the same files in Abyss server, the page displays and works correctly.
Thanks

Leledumbo

  • Hero Member
  • *****
  • Posts: 7508
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Brook Framework Error
« Reply #5 on: February 15, 2017, 08:44:28 am »
Thanks Leledumbo!
It seems that there is something not working correct with the builtin server (probably a setting on my end). I get the default page displayed but the the css and js files are not used and the click event from the js file is not working. When I run the same files in Abyss server, the page displays and works correctly.
Thanks
That's weird, in my case it works as is unmodified. See attached image.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus