您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

83 行
2.2KB

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

Powered by TurnKey Linux.