Skip to content

Commit 0451654

Browse files
server
1 parent 3dadb3a commit 0451654

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

server.f.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { utf8 } from 'functionalscript/text/module.f.js'
2-
import { type Vec } from 'functionalscript/types/bit_vec/module.f.js'
2+
import { length, type Vec } from 'functionalscript/types/bit_vec/module.f.js'
33
import { pure } from 'functionalscript/types/effects/module.f.js'
44
import {
55
createServer,
@@ -53,6 +53,10 @@ const listener = ({ url }: IncomingMessage) => {
5353
body: o ? v : utf8('404 not found'),
5454
})
5555
})
56+
.step(x =>
57+
log(`served: ${length(x.body) >> 3n} bytes`)
58+
.step(() => pure(x))
59+
)
5660
}
5761

5862
const main: NodeProgram = () => createServer(listener)

0 commit comments

Comments
 (0)