From 9e4076e1ea7c60d012433efb80dcb21cde1b90de Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 19 Oct 2024 19:41:04 +0200 Subject: [PATCH] Elysia init --- api/.gitignore | 42 ++++++++++++++++++++++++++++++++++++++++++ api/bun.lockb | Bin 0 -> 4196 bytes api/package.json | 17 +++++++++++++++++ api/src/index.ts | 5 +++++ api/tsconfig.json | 14 ++++++++++++++ shell.nix | 1 + 6 files changed, 79 insertions(+) create mode 100644 api/.gitignore create mode 100755 api/bun.lockb create mode 100644 api/package.json create mode 100644 api/src/index.ts create mode 100644 api/tsconfig.json diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 00000000..87e56100 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +**/*.trace +**/*.zip +**/*.tar.gz +**/*.tgz +**/*.log +package-lock.json +**/*.bun \ No newline at end of file diff --git a/api/bun.lockb b/api/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..327eb02f57c5df901af922542bce2c702f3f5fdf GIT binary patch literal 4196 zcmd^CYfw{16uya}YE)2*)cOomWfXI75<);80YO?T9TibjP-;jna4{q?_XY%8p;nPm z5%JMdEJY9>qqa&_Y<*H4d}FmnEv@3KR`E4D)$vh&8eYo-zz14SFsC5aY;7>ZPH)J{!e^t3d|Xin2`(sY?vND#zhfA293?2%k6 z^JrUqUT*DYm+w)vp{FJeUe$E>$7}b7SlwU{h}f=(c7M@1d^-^jAT%b%_8+a!WEl-X zOoG;%1d$U3x(jGE=uV)uM&ne5whblPL;JLVAUc5V31)Q!T?=jWzr=q*)~Flv&P1%Z z{IEWxZcgWjybVY9m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22HL>c zCe)f46W7A5FGPbOFYE)`U>A^SEigZ4C@}ISOZjMNh2fcX1Nxb^)E9l-dH{ua#9bTMg(8R%$z7w&>!|#D7lx0p6r4rvLx| literal 0 HcmV?d00001 diff --git a/api/package.json b/api/package.json new file mode 100644 index 00000000..8fc08dd1 --- /dev/null +++ b/api/package.json @@ -0,0 +1,17 @@ +{ + "name": "api", + "version": "1.0.50", + "scripts": { + "dev": "bun --watch src/index.ts", + "build": "bun build src/index.ts --target bun --outdir ./dist", + "start": "NODE_ENV=production bun dist/index.js", + "test": "bun test" + }, + "dependencies": { + "elysia": "latest" + }, + "devDependencies": { + "bun-types": "latest" + }, + "module": "src/index.js" +} diff --git a/api/src/index.ts b/api/src/index.ts new file mode 100644 index 00000000..8f28d368 --- /dev/null +++ b/api/src/index.ts @@ -0,0 +1,5 @@ +import { Elysia } from "elysia"; + +const app = new Elysia().get("/", () => "Hello Elysia").listen(3000); + +console.log(`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`); diff --git a/api/tsconfig.json b/api/tsconfig.json new file mode 100644 index 00000000..e03f1d36 --- /dev/null +++ b/api/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2021", + "module": "ES2022", + "moduleResolution": "node", + "types": [ + "bun-types" + ], + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true + } +} diff --git a/shell.nix b/shell.nix index 22e5f9c8..7e882007 100644 --- a/shell.nix +++ b/shell.nix @@ -42,6 +42,7 @@ in sqlc go-swag robotframework-tidy + bun ]; DOTNET_ROOT = "${dotnet}";