Skip to content

Commit

Permalink
Added a basic Bun app.
Browse files Browse the repository at this point in the history
  • Loading branch information
rudimk committed Nov 26, 2024
1 parent 8c61063 commit 90eb077
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Binary file added bun.lockb
Binary file not shown.
8 changes: 8 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const server = Bun.serve({
port: 3839,
fetch(request) {
return Response.json({en: "Welcome to Bun & Porter!", zh: "欢迎来到 Bun & Porter!", ja: "Bun & Porterへようこそ!", th: "ยินดีต้อนรับสู่ Bun & Porter!"});
},
});

console.log(`Listening on ${server.url}`);
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "bun-getting-started",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}
27 changes: 27 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}

0 comments on commit 90eb077

Please sign in to comment.