Skip to content

keroxp/servest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9a2892c Â· Oct 3, 2022
Apr 15, 2021
Mar 16, 2021
May 2, 2020
Apr 26, 2020
Jul 26, 2021
Jul 2, 2021
May 13, 2020
Jul 2, 2021
Jul 2, 2021
Oct 5, 2019
Mar 18, 2019
Sep 26, 2019
Mar 16, 2021
Jul 19, 2020
Mar 9, 2019
Apr 14, 2021
Oct 3, 2022
Apr 14, 2021
Apr 14, 2021
May 13, 2020
Oct 10, 2020
Apr 14, 2021
Apr 15, 2021
Mar 16, 2021
Mar 16, 2021
May 13, 2020
Apr 15, 2021
Oct 10, 2020
Mar 16, 2021
Oct 10, 2020
Dec 31, 2020
Apr 15, 2021
Apr 15, 2021
May 13, 2020
Aug 17, 2020
Apr 26, 2020
May 13, 2020
May 23, 2020
Sep 16, 2019
May 13, 2020
Oct 10, 2020
Apr 12, 2020
May 13, 2020
Oct 10, 2020
May 13, 2020
Jul 2, 2021
Jul 2, 2021
Jul 2, 2021
Apr 15, 2021
Mar 16, 2021
Mar 16, 2021
May 13, 2020
May 13, 2020
Jul 2, 2021
Oct 10, 2020
Apr 15, 2021
Apr 15, 2021
Apr 14, 2021
Apr 15, 2021
Apr 15, 2021

Repository files navigation

DEPRECADED!

This projected has been deprecated and no longer maintained. No PR/Issues will be responded.

servest

Build Status https://img.shields.io/github/tag/keroxp/servest.svg license

🌾A progressive http server for Deno🌾

Description

Servest is a http module suite for Deno. It is composed of three major APIs of HTTP protocol:

  • App API: General purpose HTTP routing server.
  • Server API: Low-level HTTP API for processing HTTP/1.1 requests.
  • Agent API: Low-level API for managing HTTP/1.1 Keep-Alive connection to the host.

In order to experiment and be progressive, we have our own implementation of HTTP/1.1 server apart from std/http.

Usage

// @deno-types="https://deno.land/x/servest/types/react/index.d.ts"
import React from "https://dev.jspm.io/react/index.js";
// @deno-types="https://deno.land/x/servest/types/react-dom/server/index.d.ts"
import ReactDOMServer from "https://dev.jspm.io/react-dom/server.js";
import { createApp } from "https://deno.land/x/servest/mod.ts";

const app = createApp();
app.handle("/", async (req) => {
  await req.respond({
    status: 200,
    headers: new Headers({
      "content-type": "text/html; charset=UTF-8",
    }),
    body: ReactDOMServer.renderToString(
      <html>
        <head>
          <meta charSet="utf-8" />
          <title>servest</title>
        </head>
        <body>Hello Servest!</body>
      </html>,
    ),
  });
});
app.listen({ port: 8888 });

License

MIT