-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
537 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import worker from "./src/worker.mjs"; | ||
|
||
worker.port = +(process.env.PORT || 8080); | ||
const environment = process.env.NODE_ENV ?? "development" | ||
worker.development = process.env.NODE_ENV==="development" | ||
|
||
const server = Bun.serve(worker); | ||
console.log(`[${environment}] Listening on ${server.url.origin}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//deprecated: | ||
//import {serve} from "https://deno.land/std/http/mod.ts" | ||
|
||
import worker from "./src/worker.mjs"; | ||
|
||
const port = +(process.env.PORT || 8080); | ||
|
||
Deno.serve({port}, worker.fetch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createServerAdapter } from '@whatwg-node/server' | ||
import { createServer } from 'node:http' | ||
import worker from "./src/worker.mjs"; | ||
|
||
const port = +(process.env.PORT || 8080); | ||
|
||
const serverAdapter = createServerAdapter(worker.fetch) | ||
const server = createServer(serverAdapter) | ||
server.listen(port, () => { | ||
console.log('Listening on:', server.address()); | ||
}) |
Oops, something went wrong.