add cookiestorage, add better immuteable handing

This commit is contained in:
2023-05-10 16:28:01 +02:00
parent 4ed1c7c812
commit 11e7ff63f8
2 changed files with 74 additions and 9 deletions

View File

@@ -3,8 +3,11 @@ import { HTTPServer } from "../http_server.ts";
const httpServer = new HTTPServer();
httpServer.add("GET", "/", (_req, rep) => {
rep.statusCode = Status.Teapot;
rep.addHeader("working", "true");
rep.status(Status.Teapot)
.header("working", "true")
.cookie("working", "true");
console.log(_req.cookie("working"));
return JSON.stringify(
{
code: Status.Teapot,