URLRouter_frMain.lfm 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. object frMain: TfrMain
  2. Left = 253
  3. Height = 160
  4. Top = 126
  5. Width = 320
  6. Caption = 'HTTP router example'
  7. ClientHeight = 160
  8. ClientWidth = 320
  9. Position = poDesktopCenter
  10. LCLVersion = '2.0.10.0'
  11. object lbPort: TLabel
  12. Left = 20
  13. Height = 15
  14. Top = 22
  15. Width = 22
  16. Caption = 'Port'
  17. ParentColor = False
  18. end
  19. object edPort: TSpinEdit
  20. Left = 49
  21. Height = 23
  22. Top = 17
  23. Width = 66
  24. MaxValue = 65535
  25. OnChange = edPortChange
  26. TabOrder = 0
  27. end
  28. object btStart: TButton
  29. Left = 128
  30. Height = 25
  31. Top = 18
  32. Width = 75
  33. Action = acStart
  34. TabOrder = 1
  35. end
  36. object btStop: TButton
  37. Left = 216
  38. Height = 25
  39. Top = 18
  40. Width = 75
  41. Action = acStop
  42. TabOrder = 2
  43. end
  44. object lbLink: TLabel
  45. Cursor = crHandPoint
  46. Left = 20
  47. Height = 15
  48. Top = 64
  49. Width = 83
  50. Caption = 'http://localhost'
  51. Enabled = False
  52. Font.Color = clBlue
  53. Font.Style = [fsUnderline]
  54. ParentColor = False
  55. ParentFont = False
  56. OnClick = lbLinkClick
  57. OnMouseEnter = lbLinkMouseEnter
  58. OnMouseLeave = lbLinkMouseLeave
  59. end
  60. object alMain: TActionList
  61. Left = 136
  62. Top = 48
  63. object acStart: TAction
  64. Category = 'HTTP server'
  65. Caption = '&Start'
  66. OnExecute = acStartExecute
  67. ShortCut = 120
  68. end
  69. object acStop: TAction
  70. Category = 'HTTP server'
  71. Caption = 'S&top'
  72. Enabled = False
  73. OnExecute = acStopExecute
  74. ShortCut = 121
  75. end
  76. end
  77. object BrookHTTPServer1: TBrookHTTPServer
  78. NoFavicon = True
  79. OnRequest = BrookHTTPServer1Request
  80. OnRequestError = BrookHTTPServer1RequestError
  81. OnStart = BrookHTTPServer1Start
  82. OnStop = BrookHTTPServer1Stop
  83. Left = 56
  84. Top = 96
  85. end
  86. object BrookURLRouter1: TBrookURLRouter
  87. Routes = <
  88. item
  89. Default = True
  90. Pattern = '/home'
  91. Methods = [rmGET]
  92. OnRequest = BrookURLRouter1Routes0Request
  93. end
  94. item
  95. Pattern = '/download/(?P<file>[a-z]+)'
  96. Methods = [rmGET]
  97. OnRequest = BrookURLRouter1Routes1Request
  98. end
  99. item
  100. Pattern = '/page/([0-9]+)'
  101. Methods = [rmGET]
  102. OnRequest = BrookURLRouter1Routes2Request
  103. end>
  104. OnNotFound = BrookURLRouter1NotFound
  105. Left = 208
  106. Top = 96
  107. end
  108. end