Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp authored Sep 7, 2019
1 parent fc4c6e0 commit 00d0671
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
- run:
name: Install Deno
command: |
curl -fsSL https://deno.land/x/install/install.sh | bash -s -- v0.15.0
curl -fsSL https://deno.land/x/install/install.sh | bash -s -- v0.17.0
- run:
name: Run Tests
command: |
export PATH=$HOME/.deno/bin:$PATH
deno -A tests.ts
deno -A tests.ts
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
[![CircleCI](https://circleci.com/gh/keroxp/servest.svg?style=svg)](https://circleci.com/gh/keroxp/servest)
![https://img.shields.io/github/tag/keroxp/servest.svg](https://img.shields.io/github/tag/keroxp/servest.svg)
[![license](https://img.shields.io/github/license/keroxp/servest.svg)](https://github.com/keroxp/servest)
[![tag](https://img.shields.io/badge/deno__std-v0.15.0-green.svg)](https://github.com/denoland/deno_std)
[![tag](https://img.shields.io/badge/deno-v0.15.0-green.svg)](https://github.com/denoland/deno)
[![tag](https://img.shields.io/badge/deno__std-v0.17.0-green.svg)](https://github.com/denoland/deno_std)
[![tag](https://img.shields.io/badge/deno-v0.17.0-green.svg)](https://github.com/denoland/deno)

🌾A progressive http server / router for deno🌾

## Usage

### Serve API

Serve API is similar to [deno_std@v0.15.0](https://github.com/denoland/deno_std/blob/master/http/server.ts) but has different implementation.
Serve API is similar to [deno_std@v0.17.0](https://github.com/denoland/deno_std/blob/master/http/server.ts) but has different implementation.
Some progressive features for HTTP/1.1 server are implemented.

- Support Keep-Alive connection
Expand Down
4 changes: 2 additions & 2 deletions agent.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { ClientRequest, ClientResponse } from "./server.ts";
import { assert } from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { defer, Deferred } from "./promises.ts";
import { readResponse, writeRequest } from "./serveio.ts";
import Conn = Deno.Conn;
import {
BufReader,
BufWriter
} from "https://deno.land/std@v0.15.0/io/bufio.ts";
} from "https://deno.land/std@v0.17.0/io/bufio.ts";
import Reader = Deno.Reader;

/** keep-alive http agent for single host. each message will be sent in serial */
Expand Down
6 changes: 3 additions & 3 deletions agent_test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import { defer, Deferred } from "./promises.ts";
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";
import { createAgent } from "./agent.ts";
import { createRouter } from "./router.ts";
import {
assertEquals,
assertThrows
} from "https://deno.land/std@v0.15.0/testing/asserts.ts";
} from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import Reader = Deno.Reader;
import Buffer = Deno.Buffer;
import copy = Deno.copy;
Expand Down
4 changes: 2 additions & 2 deletions fixtures/gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { writeRequest, writeResponse, writeTrailers } from "../serveio.ts";
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
import { StringReader } from "https://deno.land/std@v0.15.0/io/readers.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";
import { StringReader } from "https://deno.land/std@v0.17.0/io/readers.ts";

async function main() {
await basicRequestGet();
Expand Down
4 changes: 2 additions & 2 deletions readers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { BufReader } from "https://deno.land/std@v0.15.0/io/bufio.ts";
import { TextProtoReader } from "https://deno.land/std@v0.15.0/textproto/mod.ts";
import { BufReader } from "https://deno.land/std@v0.17.0/io/bufio.ts";
import { TextProtoReader } from "https://deno.land/std@v0.17.0/textproto/mod.ts";
import { promiseInterrupter } from "./promises.ts";
import Reader = Deno.Reader;
import EOF = Deno.EOF;
Expand Down
12 changes: 6 additions & 6 deletions readers_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import { BodyReader, TimeoutReader } from "./readers.ts";
import { assertThrowsAsync } from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { assertThrowsAsync } from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import ReadResult = Deno.ReadResult;
import { BufReader } from "https://deno.land/std@v0.15.0/io/bufio.ts";
import { StringReader } from "https://deno.land/std@v0.15.0/io/readers.ts";
import { assertEquals } from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { decode } from "https://deno.land/std@v0.15.0/strings/decode.ts";
import { BufReader } from "https://deno.land/std@v0.17.0/io/bufio.ts";
import { StringReader } from "https://deno.land/std@v0.17.0/io/readers.ts";
import { assertEquals } from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { decode } from "https://deno.land/std@v0.17.0/strings/decode.ts";
import { TimeoutError } from "./promises.ts";

test(async function readersBodyReader() {
Expand Down
8 changes: 4 additions & 4 deletions responder_test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import { createResponder } from "./responder.ts";
import {
assert,
assertEquals,
assertThrowsAsync
} from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { StringReader } from "https://deno.land/std@v0.15.0/io/readers.ts";
} from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { StringReader } from "https://deno.land/std@v0.17.0/io/readers.ts";
import { readResponse } from "./serveio.ts";
import { StringWriter } from "https://deno.land/std@v0.15.0/io/writers.ts";
import { StringWriter } from "https://deno.land/std@v0.17.0/io/writers.ts";
import Buffer = Deno.Buffer;
import copy = Deno.copy;
import Reader = Deno.Reader;
Expand Down
2 changes: 1 addition & 1 deletion router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { listenAndServe, ServeOptions, ServerRequest } from "./server.ts";
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";

export type RoutedServerRequest = ServerRequest & {
match?: RegExpMatchArray;
Expand Down
6 changes: 3 additions & 3 deletions router_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { createRouter, findLongestAndNearestMatch } from "./router.ts";
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import { defer } from "./promises.ts";
import {
assert,
assertEquals
} from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { StringReader } from "https://deno.land/std@v0.15.0/io/readers.ts";
} from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { StringReader } from "https://deno.land/std@v0.17.0/io/readers.ts";

test(function httpMatchNearest() {
assertEquals(
Expand Down
10 changes: 5 additions & 5 deletions serveio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import {
BufReader,
BufWriter
} from "https://deno.land/std@v0.15.0/io/bufio.ts";
import { TextProtoReader } from "https://deno.land/std@v0.15.0/textproto/mod.ts";
} from "https://deno.land/std@v0.17.0/io/bufio.ts";
import { TextProtoReader } from "https://deno.land/std@v0.17.0/textproto/mod.ts";
import {
BodyReader,
ChunkedBodyReader,
readUntilEof,
TimeoutReader
} from "./readers.ts";
import { defer, promiseInterrupter } from "./promises.ts";
import { assert } from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import {
ClientRequest,
IncomingHttpRequest,
Expand All @@ -23,8 +23,8 @@ import {
import Reader = Deno.Reader;
import Writer = Deno.Writer;
import Buffer = Deno.Buffer;
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
import { decode } from "https://deno.land/std@v0.15.0/strings/decode.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";
import { decode } from "https://deno.land/std@v0.17.0/strings/decode.ts";
import EOF = Deno.EOF;

function bufReader(r: Reader): BufReader {
Expand Down
6 changes: 3 additions & 3 deletions serveio_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import {
parseKeepAlive,
readRequest,
Expand All @@ -9,8 +9,8 @@ import {
import {
assert,
assertEquals
} from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
} from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";
import Reader = Deno.Reader;
import Buffer = Deno.Buffer;
import copy = Deno.copy;
Expand Down
2 changes: 1 addition & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Reader = Deno.Reader;
import {
BufReader,
BufWriter
} from "https://deno.land/std@v0.15.0/io/bufio.ts";
} from "https://deno.land/std@v0.17.0/io/bufio.ts";
import { defer, Deferred, promiseInterrupter } from "./promises.ts";
import { initServeOptions, readRequest } from "./serveio.ts";
import { createResponder, ServerResponder } from "./responder.ts";
Expand Down
10 changes: 5 additions & 5 deletions server_test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
import { runIfMain, test } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runIfMain, test } from "https://deno.land/std@v0.17.0/testing/mod.ts";
import { defer } from "./promises.ts";
import { listenAndServe } from "./server.ts";
import { StringReader } from "https://deno.land/std@v0.15.0/io/readers.ts";
import { StringWriter } from "https://deno.land/std@v0.15.0/io/writers.ts";
import { StringReader } from "https://deno.land/std@v0.17.0/io/readers.ts";
import { StringWriter } from "https://deno.land/std@v0.17.0/io/writers.ts";
import {
assertEquals,
assertThrowsAsync
} from "https://deno.land/std@v0.15.0/testing/asserts.ts";
import { encode } from "https://deno.land/std@v0.15.0/strings/encode.ts";
} from "https://deno.land/std@v0.17.0/testing/asserts.ts";
import { encode } from "https://deno.land/std@v0.17.0/strings/encode.ts";
import { createAgent } from "./agent.ts";
import copy = Deno.copy;
import { promiseTimeout } from "./test_util.ts";
Expand Down
2 changes: 1 addition & 1 deletion tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "./responder_test.ts";
import "./router_test.ts";
import "./serveio_test.ts";
import "./agent_test.ts";
import { runTests } from "https://deno.land/std@v0.15.0/testing/mod.ts";
import { runTests } from "https://deno.land/std@v0.17.0/testing/mod.ts";
runTests({ exitOnFail: true }).then(() => {
Deno.exit(0);
});

0 comments on commit 00d0671

Please sign in to comment.