Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: misc #99

Merged
merged 2 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
run: |
make mod.ts
git diff --exit-code
- name: Check license
run: deno --allow-read tools/license_checker.ts
- name: Run Tests
run: |
make test
Expand Down
4 changes: 2 additions & 2 deletions .licenserc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"**/*.ts": "// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.",
"ignore": ["tests.ts", "vendor/", "fixtures/", "types/"]
"**/*.ts": "// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.",
"ignore": ["mod.ts", "vendor/", "tools/", "fixtures/", "types/"]
}
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
_: deno.d.ts tsconfig.json
check:
deno --allow-read --allow-run --allow-write https://denopkg.com/kt3k/[email protected]/main.ts --inject
deno.d.ts:
deno --types > deno.d.ts
tsconfig.json:
Expand Down
2 changes: 1 addition & 1 deletion agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { ClientResponse } from "./server.ts";
import { assert } from "./vendor/https/deno.land/std/testing/asserts.ts";
import { readResponse, writeRequest } from "./serveio.ts";
Expand Down
2 changes: 1 addition & 1 deletion agent_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { createAgent } from "./agent.ts";
import { createApp } from "./app.ts";
Expand Down
2 changes: 1 addition & 1 deletion app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
listenAndServe,
listenAndServeTLS,
Expand Down
2 changes: 1 addition & 1 deletion app_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, App } from "./app.ts";
import {
assertEquals,
Expand Down
2 changes: 1 addition & 1 deletion benchmark/listen_bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { listenAndServe } from "../server.ts";

const addr = Deno.args[1] || "127.0.0.1:4500";
Expand Down
2 changes: 1 addition & 1 deletion benchmark/listen_file_bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { listenAndServe } from "../server.ts";

const addr = Deno.args[1] || "127.0.0.1:4500";
Expand Down
2 changes: 1 addition & 1 deletion benchmark/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
export async function main() {
const tgt = Deno.env()["TARGET"];
console.log("start benching for " + tgt);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/router_bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.

import { createRouter } from "../router.ts";
Expand Down
2 changes: 1 addition & 1 deletion benchmark/std_bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { serve } from "https://deno.land/[email protected]/http/server.ts";
const body = new TextEncoder().encode("Hello World");
const it = serve(":4500");
Expand Down
2 changes: 1 addition & 1 deletion benchmark/std_file_bench.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { serve } from "https://deno.land/[email protected]/http/server.ts";
const it = serve(":4500");
async function main() {
Expand Down
2 changes: 1 addition & 1 deletion body_parser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
FormFile,
isFormFile,
Expand Down
2 changes: 1 addition & 1 deletion body_parser_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
MultipartWriter,
} from "./vendor/https/deno.land/std/mime/multipart.ts";
Expand Down
2 changes: 1 addition & 1 deletion cookie.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { toIMF } from "./vendor/https/deno.land/std/datetime/mod.ts";

export type SetCookieOpts = {
Expand Down
2 changes: 1 addition & 1 deletion cookie_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
assert,
assertEquals,
Expand Down
3 changes: 1 addition & 2 deletions error.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { kHttpStatusMessages } from "./serveio.ts";

// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
export class RoutingError extends Error {
constructor(readonly status: number, msg?: string) {
super(msg ?? kHttpStatusMessages[status]);
Expand Down
2 changes: 1 addition & 1 deletion fixtures/gen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { writeRequest, writeResponse, writeTrailers } from "../serveio.ts";
import { encode } from "../vendor/https/deno.land/std/strings/encode.ts";
import { StringReader } from "../vendor/https/deno.land/std/io/readers.ts";
Expand Down
2 changes: 1 addition & 1 deletion jsx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { FC } from "./types/react/index.d.ts";

export type DFC<P = {}> = FC<P> & {
Expand Down
2 changes: 1 addition & 1 deletion logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
red,
yellow,
Expand Down
2 changes: 1 addition & 1 deletion matcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import * as path from "./vendor/https/deno.land/std/path/mod.ts";
/**
* Find the match that appeared in the nearest position to the beginning of word.
Expand Down
2 changes: 1 addition & 1 deletion matcher_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
findLongestAndNearestMatches,
resolveIndexPath,
Expand Down
1 change: 1 addition & 0 deletions media_types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
const kBasicContentTypes: [string, string][] = [
[".html", "text/html"],
[".md", "text/markdown"],
Expand Down
2 changes: 1 addition & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { RoutingError } from "./error.ts";
import { Sha1 } from "./vendor/https/deno.land/std/ws/sha1.ts";
import { assert } from "./vendor/https/deno.land/std/testing/asserts.ts";
Expand Down
1 change: 1 addition & 0 deletions middleware_test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { basicAuth } from "./middleware.ts";
import { group } from "./test_util.ts";
import {
Expand Down
1 change: 0 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from "./logger.ts";
export * from "./matcher.ts";
export * from "./media_types.ts";
export * from "./middleware.ts";
export * from "./mod.ts";
export * from "./promises.ts";
export * from "./readers.ts";
export * from "./responder.ts";
Expand Down
2 changes: 1 addition & 1 deletion promises.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.

export class TimeoutError extends Error {}

Expand Down
2 changes: 1 addition & 1 deletion readers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { BufReader } from "./vendor/https/deno.land/std/io/bufio.ts";
import {
TextProtoReader,
Expand Down
2 changes: 1 addition & 1 deletion readers_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { bodyReader, chunkedBodyReader } from "./readers.ts";
import {
assertEquals,
Expand Down
2 changes: 1 addition & 1 deletion responder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import Writer = Deno.Writer;
import { ServerResponse } from "./server.ts";
import { cookieSetter, CookieSetter } from "./cookie.ts";
Expand Down
2 changes: 1 addition & 1 deletion responder_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createResponder } from "./responder.ts";
import {
assert,
Expand Down
1 change: 1 addition & 0 deletions router.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
findLongestAndNearestMatches,
} from "./matcher.ts";
Expand Down
2 changes: 1 addition & 1 deletion router_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
assertEquals,
assertThrowsAsync,
Expand Down
2 changes: 1 addition & 1 deletion serve_jsx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import React from "./vendor/https/dev.jspm.io/react/index.js";
import ReactDOMServer from "./vendor/https/dev.jspm.io/react-dom/server.js";
import { ServeHandler } from "./server.ts";
Expand Down
2 changes: 1 addition & 1 deletion serve_jsx_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createRecorder } from "./testing.ts";
import {
assertEquals,
Expand Down
2 changes: 1 addition & 1 deletion serve_static.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import * as path from "./vendor/https/deno.land/std/path/mod.ts";
import { resolveIndexPath } from "./matcher.ts";
import { ServeHandler } from "./server.ts";
Expand Down
2 changes: 1 addition & 1 deletion serve_static_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
assertEquals,
assertMatch,
Expand Down
2 changes: 1 addition & 1 deletion serveio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
BufReader,
BufWriter,
Expand Down
2 changes: 1 addition & 1 deletion serveio_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.

import {
parseKeepAlive,
Expand Down
2 changes: 1 addition & 1 deletion server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import Conn = Deno.Conn;
import Reader = Deno.Reader;
import {
Expand Down
2 changes: 1 addition & 1 deletion server_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
handleKeepAliveConn,
listenAndServe,
Expand Down
2 changes: 1 addition & 1 deletion site/content.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { pathResolver } from "../util.ts";
import * as path from "../vendor/https/deno.land/std/path/mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion site/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env deno --allow-net --allow-read --allow-env
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { serveStatic } from "../serve_static.ts";
import { Loglevel } from "../logger.ts";
import { Layout } from "./components/layout.tsx";
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/app_server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp } from "../../../mod.ts";
const app = createApp();
// Define route with string pattern.
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/basic_auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, basicAuth } from "../../../mod.ts";
const app = createApp();
// Add global auth middleware
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/create_agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createAgent } from "../../../mod.ts";

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/get_started.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp } from "../../../mod.ts";
const app = createApp();
app.handle("/", async (req) => {
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/handle_errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, RoutingError } from "../../../mod.ts";

const app = createApp();
Expand Down
1 change: 1 addition & 0 deletions site/public/example/handle_ws.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp } from "../../../mod.ts";
import { WebSocket } from "https://deno.land/std/ws/mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion site/public/example/manage_cookie.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { RouteHandler } from "../../../mod.ts";

const handle: RouteHandler = (req) => {
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/manage_session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, ServerRequest } from "../../../mod.ts";
const app = createApp();
type User = {
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/reading_body.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, contentTypeFilter } from "../../../mod.ts";
const app = createApp();
app.post("/json", contentTypeFilter("application/json"), async (req) => {
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/simple_server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { listenAndServe } from "../../../mod.ts";
const listener = listenAndServe({ port: 8899 }, async (req) => {
await req.respond({
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/testing_handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import { createRecorder, ServeHandler } from "../../../mod.ts";

Expand Down
2 changes: 1 addition & 1 deletion site/public/example/use_middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp } from "../../../mod.ts";
const app = createApp();
// Called for every request
Expand Down
1 change: 1 addition & 0 deletions site/public/example/use_router.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, createRouter } from "../../../mod.ts";

const app = createApp();
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/use_serve_jsx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, serveJsx } from "../../../mod.ts";
const app = createApp();
// .jsx/.tsx files in ./pages directory will be dynamically imported
Expand Down
2 changes: 1 addition & 1 deletion site/public/example/use_serve_static.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { createApp, serveStatic } from "../../../mod.ts";
const app = createApp();
// All requests will be processed and matched files in "public" directory
Expand Down
9 changes: 1 addition & 8 deletions test_util.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { Router } from "./router.ts";
import {
assertThrowsAsync,
AssertionError,
assertEquals,
} from "./vendor/https/deno.land/std/testing/asserts.ts";
import { RoutingError } from "./error.ts";
import { kHttpStatusMessages } from "./serveio.ts";
Expand Down Expand Up @@ -90,14 +89,8 @@ export async function group(
await Deno.writeAll(Deno.stdout, encode("\n"));
for (const { fn, name } of tests) {
await Deno.writeAll(Deno.stdout, encode(` ${name} ... `));
const beforeRes = Deno.resources();
const beforeOps = Deno.metrics();
try {
await fn();
const afterRes = Deno.resources();
const afterOps = Deno.metrics();
if (!opts.disableOpSanitizer) {
}
await Deno.writeAll(Deno.stdout, encode(green("ok") + "\n"));
} catch (e) {
if (e instanceof AssertionError) {
Expand Down
2 changes: 1 addition & 1 deletion testing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import {
BufReader,
BufWriter,
Expand Down
2 changes: 1 addition & 1 deletion tools/gen_types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env deno --allow-net --allow-write
// Copyright 2019 Yusuke Sakurai. All rights reserved. MIT license.
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
function resolvePath(p: string): string {
const u = new URL(p, import.meta.url);
return u.pathname;
Expand Down
Loading