25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

84 satır
2.2KB

  1. <%@ Language="VBScript" %>
  2. <% Option Explicit %>
  3. <%
  4. Dim route, httpMethod, logDir, viewsDir, ctx, app, applicationName, statusLine, contentType, body, allowHeader
  5. route = Request.QueryString("route")
  6. httpMethod = Request.ServerVariables("REQUEST_METHOD")
  7. applicationName = "production"
  8. ' logs/ and Views/ deliberately live outside the served "public" webroot (IIS
  9. ' site physical path = public/), so parent-relative MapPath is required here -
  10. ' requires enableParentPaths=true for this site. See docs/DECISIONS.md.
  11. logDir = Server.MapPath("../logs")
  12. viewsDir = Server.MapPath("../Views")
  13. Set ctx = Nothing
  14. On Error Resume Next
  15. Set ctx = Server.CreateObject("WscMvc.RequestContext")
  16. If Err.Number <> 0 Then
  17. Err.Clear
  18. On Error Goto 0
  19. Response.Status = "500 Internal Server Error"
  20. Response.ContentType = "text/plain; charset=utf-8"
  21. Response.Write "Internal Server Error"
  22. Response.End
  23. End If
  24. On Error Goto 0
  25. On Error Resume Next
  26. ctx.Initialize route, httpMethod, logDir
  27. If Err.Number <> 0 Then
  28. Err.Clear
  29. On Error Goto 0
  30. Set ctx = Nothing
  31. Response.Status = "500 Internal Server Error"
  32. Response.ContentType = "text/plain; charset=utf-8"
  33. Response.Write "Internal Server Error"
  34. Response.End
  35. End If
  36. On Error Goto 0
  37. Set app = Nothing
  38. On Error Resume Next
  39. Set app = Server.CreateObject("WscMvc.Application")
  40. If Err.Number <> 0 Then
  41. Err.Clear
  42. On Error Goto 0
  43. Set ctx = Nothing
  44. Response.Status = "500 Internal Server Error"
  45. Response.ContentType = "text/plain; charset=utf-8"
  46. Response.Write "Internal Server Error"
  47. Response.End
  48. End If
  49. On Error Goto 0
  50. statusLine = ""
  51. contentType = ""
  52. body = ""
  53. allowHeader = ""
  54. On Error Resume Next
  55. app.Run ctx, applicationName, viewsDir, statusLine, contentType, body, allowHeader
  56. If Err.Number <> 0 Then
  57. Err.Clear
  58. On Error Goto 0
  59. Set app = Nothing
  60. Set ctx = Nothing
  61. Response.Status = "500 Internal Server Error"
  62. Response.ContentType = "text/plain; charset=utf-8"
  63. Response.Write "Internal Server Error"
  64. Response.End
  65. End If
  66. On Error Goto 0
  67. Response.Status = statusLine
  68. Response.ContentType = contentType
  69. If Len(allowHeader) > 0 Then
  70. Response.AddHeader "Allow", allowHeader
  71. End If
  72. Response.Write body
  73. Set app = Nothing
  74. Set ctx = Nothing
  75. %>

Powered by TurnKey Linux.