Skip to content

Commit

Permalink
Moved test runner into shared npm module
Browse files Browse the repository at this point in the history
  • Loading branch information
fileformat committed Oct 19, 2024
1 parent 146955a commit 915c272
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 231 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@jsr:registry=https://npm.jsr.io
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"start": "bun run --logLevel=debug dist/server.js",
"build": "bun build src/server.ts --outdir ./dist"
},
"type": "module"
"type": "module",
"dependencies": {
"@regexplanet/common": "npm:@jsr/regexplanet__common"
}
}
209 changes: 0 additions & 209 deletions src/runTest.ts

This file was deleted.

9 changes: 4 additions & 5 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Server } from "bun";
import type { TestInput } from "./types";
import { runTest } from "./runTest";
import type { TestInput } from "@regexplanet/common";
import { runTest } from "@regexplanet/common";

Bun.serve({
development: process.env.NODE_ENV !== "production",
Expand All @@ -13,10 +13,9 @@ Bun.serve({
},
hostname: process.env.HOSTNAME || "0.0.0.0",
idleTimeout: 15,
port: process.env.PORT || 4000,
port: process.env.PORT || 5000,
static: {
//LATER: "/": Response.redirect("https://www.regexplanet.com/advanced/bun/index.html", 302),
"/": new Response("running!"),
"/": new Response(`Running Bun v${Bun.version}`),

"/favicon.ico": new Response(await Bun.file("static/favicon.ico").bytes(), {
headers: {
Expand Down
16 changes: 0 additions & 16 deletions src/types.ts

This file was deleted.

0 comments on commit 915c272

Please sign in to comment.