Download this file
| 1 | import Hummingbird |
| 2 | |
| 3 | extension Assets { |
| 4 | /// One embedded file. The CSS and JS change only with a new build, and |
| 5 | /// the page links app.css and app.js with the build version, so |
| 6 | /// browsers may keep them for a day. |
| 7 | static func response(_ text: String, type: String) -> Response { |
| 8 | Response( |
| 9 | status: .ok, |
| 10 | headers: [.contentType: type, .cacheControl: "public, max-age=86400"], |
| 11 | body: .init(byteBuffer: ByteBuffer(string: text)) |
| 12 | ) |
| 13 | } |
| 14 | } |
| 15 | |