mirror of
https://github.com/rjNemo/deno_hello
synced 2026-06-06 01:56:40 +00:00
use deps.ts
This commit is contained in:
parent
78d7597c76
commit
17377d6a98
7 changed files with 15 additions and 6 deletions
0
src/.gitignore → .gitignore
vendored
0
src/.gitignore → .gitignore
vendored
2
cli.ts
2
cli.ts
|
|
@ -1,4 +1,4 @@
|
|||
import { readLines } from "https://deno.land/std@0.87.0/io/bufio.ts";
|
||||
import { readLines } from "./deps.ts";
|
||||
import { ID, sayHello, sayRandomHello, ValidationError } from "./src/index.ts";
|
||||
|
||||
const start = async () => {
|
||||
|
|
|
|||
7
deps.ts
Normal file
7
deps.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export {
|
||||
assert,
|
||||
assertStrictEquals,
|
||||
assertThrows,
|
||||
} from "https://deno.land/std@0.87.0/testing/asserts.ts";
|
||||
export { readLines } from "https://deno.land/std@0.87.0/io/bufio.ts";
|
||||
export { listenAndServe } from "https://deno.land/std@0.87.0/http/server.ts";
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
import { listenAndServe } from "https://deno.land/std@0.87.0/http/server.ts";
|
||||
import { listenAndServe } from "./deps.ts";
|
||||
|
||||
const port = 8000;
|
||||
|
||||
console.log(`Server listening on http://localhost:${port}/`);
|
||||
await listenAndServe({ port }, (req) => req.respond({ body: "Hello" }));
|
||||
|
||||
// write handler using req.url
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { assertStrictEquals } from "https://deno.land/std@0.87.0/testing/asserts.ts";
|
||||
import { assertStrictEquals } from "../../deps.ts";
|
||||
import { getLocaleById } from "./locales.ts";
|
||||
|
||||
Deno.test("Get locale by id", () => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { assertThrows } from "https://deno.land/std@0.87.0/testing/asserts.ts";
|
||||
import { assertThrows } from "../../deps.ts";
|
||||
import { ValidationError } from "../errors/exceptions.ts";
|
||||
import { ID } from "./id.ts";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { assertStrictEquals } from "https://deno.land/std@0.87.0/testing/asserts.ts";
|
||||
import { sayHello, sayRandomHello } from "./hello.ts";
|
||||
import { assertStrictEquals } from "../../deps.ts";
|
||||
import { ID } from "../types/id.ts";
|
||||
import { sayHello, sayRandomHello } from "./hello.ts";
|
||||
|
||||
Deno.test("Random Hello", () => {
|
||||
const result = sayRandomHello();
|
||||
|
|
|
|||
Loading…
Reference in a new issue