carlos / todomvc-bakeoff Public

Clone
git clone https://amadan.net/carlos/todomvc-bakeoff

Plain git — no account needed to clone.

Download

Download this file

1import Hummingbird
2
3extension 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