From a785fc4a76048a295b583de55f2d254faa55f4cb Mon Sep 17 00:00:00 2001 From: Georgy Shive Date: Wed, 19 Feb 2025 17:11:58 +0700 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=B4=D0=B0=D1=87=D0=B8=20=D0=BE=D0=B1=D0=BE=D1=80=D1=83=D0=B4?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 175 ++++++++++++ README.md | 15 + bun.lockb | Bin 0 -> 5313 bytes index.ts | 747 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 15 + tsconfig.json | 27 ++ 6 files changed, 979 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 bun.lockb create mode 100644 index.ts create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b1ee42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,175 @@ +# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore + +# Logs + +logs +_.log +npm-debug.log_ +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Caches + +.cache + +# Diagnostic reports (https://nodejs.org/api/report.html) + +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json + +# Runtime data + +pids +_.pid +_.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover + +lib-cov + +# Coverage directory used by tools like istanbul + +coverage +*.lcov + +# nyc test coverage + +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) + +.grunt + +# Bower dependency directory (https://bower.io/) + +bower_components + +# node-waf configuration + +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) + +build/Release + +# Dependency directories + +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) + +web_modules/ + +# TypeScript cache + +*.tsbuildinfo + +# Optional npm cache directory + +.npm + +# Optional eslint cache + +.eslintcache + +# Optional stylelint cache + +.stylelintcache + +# Microbundle cache + +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history + +.node_repl_history + +# Output of 'npm pack' + +*.tgz + +# Yarn Integrity file + +.yarn-integrity + +# dotenv environment variable files + +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) + +.parcel-cache + +# Next.js build output + +.next +out + +# Nuxt.js build / generate output + +.nuxt +dist + +# Gatsby files + +# Comment in the public line in if your project uses Gatsby and not Next.js + +# https://nextjs.org/blog/next-9-1#public-directory-support + +# public + +# vuepress build output + +.vuepress/dist + +# vuepress v2.x temp and cache directory + +.temp + +# Docusaurus cache and generated files + +.docusaurus + +# Serverless directories + +.serverless/ + +# FuseBox cache + +.fusebox/ + +# DynamoDB Local files + +.dynamodb/ + +# TernJS port file + +.tern-port + +# Stores VSCode versions used for testing VSCode extensions + +.vscode-test + +# yarn v2 + +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# IntelliJ based IDEs +.idea + +# Finder (MacOS) folder config +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..128871a --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# bun-api + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.1.27. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/bun.lockb b/bun.lockb new file mode 100644 index 0000000000000000000000000000000000000000..43d756dca376f38331971cbd3a5eaed5904be8a1 GIT binary patch literal 5313 zcmeHL4Ny~87JdlY?2tY$&;l0X82zyfL&+z}BJtzv=r!0?lVyr3YA1VPIz z6{Xf9iWG}%TVZ9D;tv$6%gFkJ%T}o1t`$VPt^BxJL8&yb=O*vM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oI;nyLubFH`(YMEV@R!XM&qEQ_h^39jFDpt>HS^e-?U}(}h15Ho6I2DvTF_pwXH{XC zjirVk68rIc2ZK~!@bXmLy*HkgZBCt}h_IWla!_umxV*IBpMAD0UUVK{;kl9fqUG}H zcu`$Q?#!OAp2(D)+#Pp%2E|ums;gpbbDQqR+6IK$58T;z@I*+MXx_EAO#IWkeA4p% zpf6r?^>^%jhRzo(y!f_OyUN<2X}%2?AC%jFy>3QMbvGT{c1)$+P}H?4OxL!dE4Kgr zH=j10a+P0_`ljnYrkzfb^p#tmX9CdejN)KD)ENkU!ZagaJ$okFpE@>L@{@euT zKW=}@{C|dF`zc}i1v8Nd6fq^vr%Y?%No(Y!LP={Q;^IhLUy&giit^?=i}|!-JEe+R zz?bqP;uO(JRn*7{HaKJyWEPzh?F^+2^W(n$73CK)Lv#YR^21y^j7xp5I%iq;x`|AHwUuIaeLKW=c< ziK{{`XOo07vC_W7k#rqUyyg=b_giMPlsz#E(g5^2MApC;;NL(*|Ct6krFY1>tkHM zayd>0+XR6tW?az%#+7tNAsro~V^-|^@XE0_H%-NFr8MNyBrT;;M#KecH40_4H(xTc zs0)V|RZGhaew-h$E782S&kp?&f!b<8DEg#-JFs3Gm^*5VkEO$k<5Zo(7n)0~3P{Jr3qaQwBIQ zd1Mo%%6JUV#ob_CLmPrRp1&h&2PpIxk|6<*IW!nA)WbRq*q}c`!H{pGnT}GmnHnSN zEG^(e%0g$zZ5K#y@F!8ZSs@>P_1S8`!X65Z**IP-4U-UUqXE5*78 data) + .listen(3000); + +console.log(`Server running on http://localhost:3000`); diff --git a/package.json b/package.json new file mode 100644 index 0000000..7a48bc4 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "bun-api", + "module": "index.ts", + "type": "module", + "devDependencies": { + "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "dependencies": { + "@elysiajs/cors": "^1.2.0", + "elysia": "^1.2.12" + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..238655f --- /dev/null +++ b/tsconfig.json @@ -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 + } +}