Vapor 4.0.0 Beta 3 发布

更新日志

Example output:

# TYPE http_requests_total counter
http_requests_total 0
http_requests_total{status="200", path="GET /hello/:name", method="GET"} 7
http_requests_total{status="200", path="GET /metrics", method="GET"} 3
# TYPE http_request_duration_seconds summary
http_request_duration_seconds{quantile="0.01"} 0.000115894
http_request_duration_seconds{quantile="0.05"} 0.000115894
...
  • Updates to RoutingKit beta 3 (#2126)

  • ClientResponse, HTTPStatus, and HTTPHeaders are now Codable (#2124)

  • Environment variables loaded from .env files can now be accessed immediately after Application has initialized (#2125)

.env (in same folder as Package.swift)

FOO=BAR

main.swift

let app = Application(...)
defer { app.shutdown() } 

let foo = Environment.get("FOO") 
print(foo) // BAR

发表评论

电子邮件地址不会被公开。 必填项已用*标注