A server-side web framework written in Forth. http://www.1-9-9-1.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0KB

  1. \ App demo:
  2. include ../1991.fs
  3. sourcedir s" public" s+ set-public-path
  4. sourcedir s" views/" s+ set-view-path
  5. : handle-/ s" fff" ;
  6. : handle-hi s" hi!" ;
  7. \ Basic routing:
  8. /1991 / handle-/
  9. /1991 /hi handle-hi
  10. \ Views:
  11. : page-title s" hmmmm" ;
  12. : handle-/index
  13. s" index.html" render-view ;
  14. : handle-import
  15. s" import-version.html" render-view ;
  16. /1991 /index handle-/index
  17. /1991 /import handle-import
  18. : handle-uid
  19. s" uid:" get-query-string s+ ;
  20. : handle-uid-new
  21. s" uid:new:" get-query-string s+ ;
  22. : handle-uid-delete
  23. s" uid:delete:" get-query-string s+ ;
  24. : handle-pid
  25. s" pid:" get-query-string s+ ;
  26. : handle-pid-new
  27. s" pid:new:" get-query-string s+ ;
  28. : handle-pid-delete
  29. s" pid:delete:" get-query-string s+ ;
  30. /1991 /api/v1/users/<uid> handle-uid
  31. /1991 /api/v1/users/<uid>/new handle-uid-new
  32. /1991 /api/v1/users/<uid>/delete handle-uid-delete
  33. /1991 /api/v1/users/<uid>/post/<pid> handle-pid
  34. /1991 /api/v1/users/<uid>/post/<pid>/new handle-pid-new
  35. /1991 /api/v1/users/<uid>/post/<pid>/delete handle-pid-delete
  36. 8080 1991: