New Project
Last updated
Last updated
Deno has a built in HTTP server API that allows you to write HTTP/1.1
and HTTP/2
servers.
Inside VSCode you may want to execute:
This will create a .vscode
on the project to enable Deno extension to work.
The HTTP server has built in automatic compression of response bodies. (Supporting gzip
and brotli
compression)
Check some conditions for this automatic compression .
req.text()
call and ALL other methods that read from the Request Body can fail if the user hangs up the connection before the body is fully received.
Make sure to handle this case.
For HTTPS
make sure to add two more parameters.
Deno can upgrade incoming HTTP requests to a WebSocket.
Note that WebSockets are only supported on HTTP/1.1
for now.
Don't forget to give the --allow-net
permissions.
Check an example .